diff options
author | Jesse Luehrs <doy@tozt.net> | 2021-12-25 22:43:11 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2021-12-25 22:43:11 -0500 |
commit | a4a895c8aa24664ee0d0418115015efd10f483c4 (patch) | |
tree | 1108c72dcb6b4ffe72d3a76b0e250120c251e8ec /src | |
parent | a142c3484e75341d3b1fe35959246969cc908f77 (diff) | |
download | nbsh-a4a895c8aa24664ee0d0418115015efd10f483c4.tar.gz nbsh-a4a895c8aa24664ee0d0418115015efd10f483c4.zip |
error message consistency
Diffstat (limited to 'src')
-rw-r--r-- | src/state/history/builtins.rs | 8 | ||||
-rw-r--r-- | src/state/history/mod.rs | 8 |
2 files changed, 7 insertions, 9 deletions
diff --git a/src/state/history/builtins.rs b/src/state/history/builtins.rs index 61cc943..3186bb8 100644 --- a/src/state/history/builtins.rs +++ b/src/state/history/builtins.rs @@ -88,11 +88,13 @@ async fn cd( } else { dir.into() }; - let code = match std::env::set_current_dir(dir) { + let code = match std::env::set_current_dir(&dir) { Ok(()) => 0, Err(e) => { - env.write_vt(format!("{}: {}", exe.exe(), e).as_bytes()) - .await; + env.write_vt( + format!("{}: {}: {}", exe.exe(), e, dir.display()).as_bytes(), + ) + .await; 1 } }; diff --git a/src/state/history/mod.rs b/src/state/history/mod.rs index 7d0b38a..581dc58 100644 --- a/src/state/history/mod.rs +++ b/src/state/history/mod.rs @@ -651,12 +651,8 @@ async fn run_exe( Err(e) => { let mut entry = env.entry().await; entry.vt.process( - format!( - "nbsh: failed to run {}: {}", - exe.exe(), - e.source().unwrap() - ) - .as_bytes(), + format!("nbsh: {}: {}", e.source().unwrap(), exe.exe()) + .as_bytes(), ); return async_std::process::ExitStatus::from_raw(1 << 8); } |