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/history.rs | |
| parent | refactor server to allow pluggable db and tracing (#1036) (diff) | |
| download | atuin-a6da5340e7f034ca66c4130d0be6799d59eb19c3.zip | |
add support to override hostname and username via env var (#1041)
Diffstat (limited to 'atuin-client/src/history.rs')
| -rw-r--r-- | atuin-client/src/history.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/atuin-client/src/history.rs b/atuin-client/src/history.rs index bb50a02a..05bfbf7f 100644 --- a/atuin-client/src/history.rs +++ b/atuin-client/src/history.rs @@ -49,8 +49,13 @@ impl History { let session = session .or_else(|| env::var("ATUIN_SESSION").ok()) .unwrap_or_else(|| uuid_v7().as_simple().to_string()); - let hostname = - hostname.unwrap_or_else(|| format!("{}:{}", whoami::hostname(), whoami::username())); + let hostname = hostname.unwrap_or_else(|| { + format!( + "{}:{}", + env::var("ATUIN_HOST_NAME").unwrap_or_else(|_| whoami::hostname()), + env::var("ATUIN_HOST_USER").unwrap_or_else(|_| whoami::username()) + ) + }); Self { id: uuid_v7().as_simple().to_string(), |
