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

Added environment variable for cf-remote path #95

Merged
merged 1 commit into from
Dec 10, 2024

Conversation

victormlg
Copy link
Contributor

Ticket: CFE-4468

Comment on lines 10 to 11
cf_remote_dir = ".cfengine" if "CF_REMOTE_DIR" not in os.environ else os.environ["CF_REMOTE_DIR"]
return path_append("~/{}/".format(cf_remote_dir), subdir)
Copy link
Member

@olehermanse olehermanse Dec 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

~ means the user's home folder, we don't want that, we want them to be able to specify a path anywhere on the file system.

Suggested change
cf_remote_dir = ".cfengine" if "CF_REMOTE_DIR" not in os.environ else os.environ["CF_REMOTE_DIR"]
return path_append("~/{}/".format(cf_remote_dir), subdir)
override_dir = os.getenv("CF_REMOTE_DIR")
if override_dir:
parent = os.path.dirname(override_dir)
if not os.path.exists(parent):
user_error(f"'{parent}' does not exist")
return path_append(override_dir, subdir)
return path_append("~/.cfengine/", subdir)

Ticket: CFE-4468
Signed-off-by: Victor Moene <[email protected]>
@olehermanse olehermanse merged commit 3ba4dbc into cfengine:master Dec 10, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants