Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it see if theres a template bridgedata #43

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions load_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@
def load_env_vars() -> None: # FIXME: there is a dynamic way to do this
"""Load the environment variables from the config file."""
yaml = YAML()
config_file = "bridgeData.yaml"
template_file = "bridgeData_template.yaml"

if not pathlib.Path("bridgeData.yaml").exists():
raise FileNotFoundError("bridgeData.yaml not found")
if not pathlib.Path(config_file).exists():
if pathlib.Path(template_file).exists():
raise FileNotFoundError(f"{template_file} found. Please set variables and rename it to {config_file}.")
raise FileNotFoundError(f"{config_file} not found")

with open("bridgeData.yaml", encoding="utf-8") as f:
with open(config_file, encoding="utf-8") as f:
config = yaml.load(f)

if "cache_home" in config:
Expand Down