diff options
-rw-r--r-- | src/env.rs | 5 | ||||
-rw-r--r-- | src/pipeline/mod.rs | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -90,6 +90,11 @@ impl Env { } } + pub fn update(&mut self) -> anyhow::Result<()> { + self.set_current_dir(std::env::current_dir()?); + Ok(()) + } + pub fn as_bytes(&self) -> Vec<u8> { bincode::serialize(self).unwrap() } diff --git a/src/pipeline/mod.rs b/src/pipeline/mod.rs index 43170da..fc6fdb0 100644 --- a/src/pipeline/mod.rs +++ b/src/pipeline/mod.rs @@ -26,10 +26,10 @@ pub async fn run() -> anyhow::Result<i32> { let mut env = read_data(shell_read).await?; run_with_env(&mut env, &shell_write).await?; let status = *env.latest_status(); - let pwd = std::env::current_dir()?; - env.set_current_dir(pwd); + env.update()?; write_event(&shell_write, Event::Exit(env)).await?; + if let Some(signal) = status.signal() { nix::sys::signal::raise(signal.try_into().unwrap())?; } |