aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src/database.rs
diff options
context:
space:
mode:
Diffstat (limited to 'atuin-client/src/database.rs')
-rw-r--r--atuin-client/src/database.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs
index 2be27ac8..8d64bf36 100644
--- a/atuin-client/src/database.rs
+++ b/atuin-client/src/database.rs
@@ -21,7 +21,10 @@ use sqlx::{
};
use time::OffsetDateTime;
-use crate::history::{HistoryId, HistoryStats};
+use crate::{
+ history::{HistoryId, HistoryStats},
+ utils::get_host_user,
+};
use super::{
history::History,
@@ -55,11 +58,7 @@ 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!(
- "{}:{}",
- env::var("ATUIN_HOST_NAME").unwrap_or_else(|_| whoami::hostname()),
- env::var("ATUIN_HOST_USER").unwrap_or_else(|_| whoami::username())
- );
+ let hostname = get_host_user();
let cwd = utils::get_current_dir();
let host_id = Settings::host_id().expect("failed to load host ID");
let git_root = utils::in_git_repo(cwd.as_str());