Skip to content

Commit

Permalink
doc: Fix logic to find incus
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
  • Loading branch information
stgraber committed Oct 7, 2023
1 parent 6e4152d commit b492e21
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,14 @@
os.symlink('../../deps/swagger-ui/dist/swagger-ui.css', '.sphinx/_static/swagger-ui/swagger-ui.css')

### MAN PAGES ###
# Find path to incus client (different for local builds and on RTD)
if ("LOCAL_SPHINX_BUILD" in os.environ and
os.environ["LOCAL_SPHINX_BUILD"] == "True"):
path = str(subprocess.check_output(['go', 'env', 'GOPATH'], encoding="utf-8").strip())
incus = os.path.join(path, 'bin', 'incus')
if os.path.isfile(incus):
print("Using " + incus + " to generate man pages.")
else:
print("Cannot find incus in " + incus)
exit(2)
# Find the path to the incus binary
path = str(subprocess.check_output(['go', 'env', 'GOPATH'], encoding="utf-8").strip())
incus = os.path.join(path, 'bin', 'incus')
if os.path.isfile(incus):
print("Using " + incus + " to generate man pages.")
else:
incus = "../incus.bin"
print("Cannot find incus in " + incus)
exit(2)

# Generate man pages content
os.makedirs('.sphinx/deps/manpages', exist_ok=True)
Expand Down

0 comments on commit b492e21

Please sign in to comment.