diff options
author | Jesse Luehrs <doy@tozt.net> | 2022-01-03 23:12:08 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2022-01-03 23:12:08 -0500 |
commit | 1a281c87758ca559b4353fbd166dcd8e92a97f3a (patch) | |
tree | 32a01ce3487c98cafb325ab49fceff566a1a3d30 /src/info.rs | |
parent | 10717b2b1f29a1b35742ae0cb98e775ac55e248c (diff) | |
download | nbsh-1a281c87758ca559b4353fbd166dcd8e92a97f3a.tar.gz nbsh-1a281c87758ca559b4353fbd166dcd8e92a97f3a.zip |
propagate current directory changes back to the main process
Diffstat (limited to 'src/info.rs')
-rw-r--r-- | src/info.rs | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/src/info.rs b/src/info.rs index 3ff2576..5653326 100644 --- a/src/info.rs +++ b/src/info.rs @@ -1,13 +1,3 @@ -pub fn pwd() -> anyhow::Result<String> { - let mut pwd = std::env::current_dir()?.display().to_string(); - if let Ok(home) = std::env::var("HOME") { - if pwd.starts_with(&home) { - pwd.replace_range(..home.len(), "~"); - } - } - Ok(pwd) -} - pub fn user() -> anyhow::Result<String> { Ok(users::get_current_username() .ok_or_else(|| anyhow::anyhow!("couldn't get username"))? |