Skip to content

Conversation

@consideRatio
Copy link
Member

If we don't constrain the --config flag to only work with files in the
current working directory, things won't behave as expected.

The project has been explicit about saying that paths resolve relative
to the config files that specify the paths, but if --config is allowed
to reference paths outside the current working directory chartpress no
longer honors its documented behavior.

Due to this, I think we should instead fail loudly than let users
experience weird behavior if --config file references a file outside the
current working directory.

@consideRatio consideRatio added the bug Something isn't working label Oct 19, 2025
If we don't constrain the --config flag to only work with files in the
current working directory, things won't behave as expected.

The project has been explicit about saying that paths resolve relative
to the config files that specify the paths, but if --config is allowed
to reference paths outside the current working directory chartpress no
longer honors its documented behavior.

Due to this, I think we should instead fail loudly than let users
experience weird behavior if --config file references a file outside the
current working directory.
Copy link
Member

@manics manics left a comment

Choose a reason for hiding this comment

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

Could we os.chdir() into the directory containing the config file instead? The behaviour will still be unambiguous, and it's more user friendly.

E.g. os.chdir(os.path.dirname(os.path.realpath("config_file")))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

2 participants