diff options
| author | Patrick Decat <pdecat@gmail.com> | 2023-03-15 00:15:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-14 23:15:39 +0000 |
| commit | efd2230eba28cea6265288315e80ca1be96783c2 (patch) | |
| tree | 1c9595b5fbff144b501b4b749698013fa35f67c1 /atuin-client/src | |
| parent | Fixes a bug on windows (#780) (diff) | |
| download | atuin-efd2230eba28cea6265288315e80ca1be96783c2.zip | |
Prefer PWD environment variable over cwd if available to better support symbolic links (#783)
Diffstat (limited to 'atuin-client/src')
| -rw-r--r-- | atuin-client/src/database.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs index d19a0b74..3b579153 100644 --- a/atuin-client/src/database.rs +++ b/atuin-client/src/database.rs @@ -1,6 +1,7 @@ use std::{env, path::Path, str::FromStr}; use async_trait::async_trait; +use atuin_common::utils; use chrono::{prelude::*, Utc}; use fs_err as fs; use itertools::Itertools; @@ -31,10 +32,7 @@ pub fn current_context() -> Context { std::process::exit(1); }; let hostname = format!("{}:{}", whoami::hostname(), whoami::username()); - let cwd = match env::current_dir() { - Ok(dir) => dir.display().to_string(), - Err(_) => String::from(""), - }; + let cwd = utils::get_current_dir(); Context { session, |
