diff --git a/README.md b/README.md index 8034798..e200a59 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ You can use the local client without a remote server. It will generate a JSON file where the strikes are stored. ## Configuration file -Provide a configuration file at ./strikes/configuration.yaml. The remote server configuration has precedence over the local configuration. +Provide a configuration file at .config/strikes/configuration.yaml. The remote server configuration has precedence over the local configuration. ```yaml remote: diff --git a/cli-client/Cargo.lock b/cli-client/Cargo.lock index 542a716..a135d57 100644 --- a/cli-client/Cargo.lock +++ b/cli-client/Cargo.lock @@ -1593,7 +1593,7 @@ dependencies = [ [[package]] name = "strikes" -version = "0.2.4" +version = "0.2.5" dependencies = [ "assert_cmd", "assert_fs", diff --git a/cli-client/Cargo.toml b/cli-client/Cargo.toml index ae45791..f139c72 100644 --- a/cli-client/Cargo.toml +++ b/cli-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "strikes" -version = "0.2.4" +version = "0.2.5" edition = "2021" [lib] diff --git a/cli-client/src/configuration.rs b/cli-client/src/configuration.rs index 6c5ee3c..1fed6a7 100644 --- a/cli-client/src/configuration.rs +++ b/cli-client/src/configuration.rs @@ -26,7 +26,7 @@ impl Default for Settings { local: { Some(LocalSettings { db_path: std::env::var("HOME") - .map(|home| PathBuf::from(home).join(".strikes/db.json")) + .map(|home| PathBuf::from(home).join(".config/strikes/db.json")) .unwrap(), }) }, @@ -39,7 +39,7 @@ pub fn get_configuration(args: &Cli) -> Settings { let config_path = args .config_path .clone() - .unwrap_or_else(|| PathBuf::from(home).join(".strikes/configuration.yaml")); + .unwrap_or_else(|| PathBuf::from(home).join(".config/strikes/configuration.yaml")); let settings = config::Config::builder().add_source(config::File::new( config_path.to_str().unwrap(), @@ -77,7 +77,7 @@ mod tests { ); assert_eq!( configuration.local.unwrap().db_path, - PathBuf::from("/home/user/.strikes") + PathBuf::from("/home/user/.config/strikes/db.json") ); } @@ -93,7 +93,7 @@ mod tests { assert_eq!( configuration.local.unwrap().db_path, - PathBuf::from("/home/user/.strikes/db.json") + PathBuf::from("/home/user/.config/strikes/db.json") ); } @@ -109,7 +109,7 @@ mod tests { assert_eq!( configuration.local.unwrap().db_path, - PathBuf::from("/home/user/.strikes/db.json") + PathBuf::from("/home/user/.config/strikes/db.json") ) } } diff --git a/cli-client/tests/fixtures/valid_config.yaml b/cli-client/tests/fixtures/valid_config.yaml index ebf64c8..8a84c50 100644 --- a/cli-client/tests/fixtures/valid_config.yaml +++ b/cli-client/tests/fixtures/valid_config.yaml @@ -1,6 +1,5 @@ -use_remote: true remote: api_key: abc base_url: https://example.com local: - db_path: /home/user/.strikes + db_path: /home/user/.config/strikes/db.json