-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Recognize $BAT_CONFIG_DIR and give it precedence over $XDG_CONFIG_HOME #1797
Recognize $BAT_CONFIG_DIR and give it precedence over $XDG_CONFIG_HOME #1797
Conversation
@@ -747,6 +747,25 @@ fn config_location_when_generating() { | |||
assert!(tmp_config_path.exists()); | |||
} | |||
|
|||
#[test] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add the new env. variable to bat_raw_command_with_config
to make sure it is removed from the environment for all integration tests? This is important in order to make sure that (all) tests pass, even in environments where a user has set some env. variables.
tests/integration_tests.rs
Outdated
// Create file at BAT_CONFIG_DIR | ||
bat_with_config() | ||
.env("BAT_CONFIG_DIR", bat_conf_dir.to_str().unwrap()) | ||
.arg("--generate-config-file") | ||
.assert() | ||
.success() | ||
.stdout( | ||
predicate::str::is_match("Success! Config file written to .*config\n") | ||
.unwrap() | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another idea for a (maybe simpler) test would be similar to config_read_arguments_from_file
. Wouldn't require a temp. directory. But I guess this is fine as well. Thank you for writing a test!
CHANGELOG.md
Outdated
@@ -2,6 +2,7 @@ | |||
|
|||
## Features | |||
|
|||
- $BAT_CONFIG_DIR is now a recognized environment variable and has precedent over $XDG_CONFIG_HOME. (@billrisher) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- $BAT_CONFIG_DIR is now a recognized environment variable and has precedent over $XDG_CONFIG_HOME. (@billrisher) | |
- `$BAT_CONFIG_DIR` is now a recognized environment variable. It has precedence over `$XDG_CONFIG_HOME`, see #1727 (@billrisher) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your contribution!
This PR closes issue #1727
I added a nearly-identical test case to one that already exists, for verbosity's sake I left it there but I understand if we'd want to wrap the new test case into an existing one.