diff options
| author | Ellie Huxtable <ellie@elliehuxtable.com> | 2022-03-17 21:26:57 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-17 21:26:57 +0000 |
| commit | d270798277cffd63c62351a57ef48ade879e755c (patch) | |
| tree | 564d0b293e962849e2e4698f6d0c78f28f504cba /src/command/history.rs | |
| parent | Update README.md (diff) | |
| download | atuin-d270798277cffd63c62351a57ef48ade879e755c.zip | |
Update config-rs (#280)
* Update config-rs
Also fix our call to current_dir
This should resolve #195
Thanks @conradludgate for the upstream fix!
* Format
Diffstat (limited to 'src/command/history.rs')
| -rw-r--r-- | src/command/history.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/command/history.rs b/src/command/history.rs index 37b4b9dd..b644b9ac 100644 --- a/src/command/history.rs +++ b/src/command/history.rs @@ -114,7 +114,12 @@ impl Cmd { return Ok(()); } - let cwd = env::current_dir()?.display().to_string(); + // It's better for atuin to silently fail here and attempt to + // store whatever is ran, than to throw an error to the terminal + let cwd = match env::current_dir() { + Ok(dir) => dir.display().to_string(), + Err(_) => String::from(""), + }; let h = History::new(chrono::Utc::now(), command, cwd, -1, -1, None, None); |
