1
1
mirror of https://github.com/ellie/atuin.git synced 2024-09-11 21:18:22 +03:00

chore: test using new config changes

This commit is contained in:
Conrad Ludgate 2021-11-21 10:29:38 +00:00
parent f2c1922e48
commit f1deca0a94
No known key found for this signature in database
GPG Key ID: 3DD1A1DB3CB4BF63
5 changed files with 9 additions and 8 deletions

View File

@ -22,7 +22,7 @@ uuid = { version = "0.8", features = ["v4"] }
indicatif = "0.16.2"
whoami = "1.1.2"
chrono-english = "0.1.4"
config = "0.11"
config = { git = "https://github.com/conradludgate/config-rs", branch = "absolute-path-current-dir" }
serde_derive = "1.0.125"
serde = "1.0.126"
serde_json = "1.0.64"

View File

@ -120,7 +120,7 @@ impl Settings {
config_file.push("config.toml");
let mut s = Config::new();
let mut s = Config::default();
let db_path = data_dir.join("history.db");
let key_path = data_dir.join("key");
@ -149,15 +149,15 @@ impl Settings {
.wrap_err("could not load environment")?;
// all paths should be expanded
let db_path = s.get_str("db_path")?;
let db_path = s.get_string("db_path")?;
let db_path = shellexpand::full(db_path.as_str())?;
s.set("db_path", db_path.to_string())?;
let key_path = s.get_str("key_path")?;
let key_path = s.get_string("key_path")?;
let key_path = shellexpand::full(key_path.as_str())?;
s.set("key_path", key_path.to_string())?;
let session_path = s.get_str("session_path")?;
let session_path = s.get_string("session_path")?;
let session_path = shellexpand::full(session_path.as_str())?;
s.set("session_path", session_path.to_string())?;

View File

@ -20,7 +20,7 @@ uuid = { version = "0.8", features = ["v4"] }
indicatif = "0.16.2"
whoami = "1.1.2"
chrono-english = "0.1.4"
config = "0.11"
config = { git = "https://github.com/conradludgate/config-rs", branch = "absolute-path-current-dir" }
serde_derive = "1.0.125"
serde = "1.0.126"
serde_json = "1.0.64"

View File

@ -34,7 +34,7 @@ impl Settings {
// create the config file if it does not exist
let mut s = Config::new();
let mut s = Config::default();
if config_file.exists() {
s.merge(ConfigFile::with_name(config_file.to_str().unwrap()))?;

View File

@ -114,7 +114,8 @@ impl Cmd {
return Ok(());
}
let cwd = env::current_dir()?.display().to_string();
let cwd = env::current_dir()
.map_or_else(|_| String::new(), |cwd| cwd.display().to_string());
let h = History::new(chrono::Utc::now(), command, cwd, -1, -1, None, None);