diff options
author | Peter Brunner <peter@lugoues.net> | 2023-06-12 12:58:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-12 16:58:46 +0000 |
commit | a6da5340e7f034ca66c4130d0be6799d59eb19c3 (patch) | |
tree | 9cd6929afd7bca75700239b1cb0039970a526be3 /atuin-client/src/database.rs | |
parent | 8655c93853506acf05f6ae4e58bfc2c6198be254 (diff) |
add support to override hostname and username via env var (#1041)
Diffstat (limited to 'atuin-client/src/database.rs')
-rw-r--r-- | atuin-client/src/database.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs index c4a9ddc32..f7c063ce8 100644 --- a/atuin-client/src/database.rs +++ b/atuin-client/src/database.rs @@ -43,7 +43,11 @@ pub fn current_context() -> Context { eprintln!("ERROR: Failed to find $ATUIN_SESSION in the environment. Check that you have correctly set up your shell."); std::process::exit(1); }; - let hostname = format!("{}:{}", whoami::hostname(), whoami::username()); + let hostname = format!( + "{}:{}", + env::var("ATUIN_HOST_NAME").unwrap_or_else(|_| whoami::hostname()), + env::var("ATUIN_HOST_USER").unwrap_or_else(|_| whoami::username()) + ); let cwd = utils::get_current_dir(); Context { |