Skip to content

Commit

Permalink
🔩 Fix up search paths for venv/binaries/
Browse files Browse the repository at this point in the history
This logic is a bit rusty imo but maybe I can look at a cleaner way some time later on.
  • Loading branch information
agriyakhetarpal committed Jan 1, 2024
1 parent a657752 commit bcb6f98
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion python_hugo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,27 @@
"binaries",
f"hugo-{hugo_version}"
)
if not os.path.exists(hugo_executable):
raise FileNotFoundError
except FileNotFoundError:
hugo_executable = os.path.join(
# Go up into the venv directory and down into the data files
os.path.dirname(
os.path.dirname(
os.path.dirname(
os.path.dirname(
os.path.dirname(__file__)
)
)
)
),
"binaries",
f"hugo-{hugo_version}",
)
if not os.path.exists(hugo_executable):
raise FileNotFoundError
except Exception as e:
print(f"Error: {e}")
print("Please open an issue")

def __call():
"""
Expand Down

0 comments on commit bcb6f98

Please sign in to comment.