diff options
| author | Jonas Maier <> | 2026-03-05 19:29:27 +0100 |
|---|---|---|
| committer | Jonas Maier <> | 2026-03-05 19:29:27 +0100 |
| commit | e79adb55ac3b94bbdd40d8b6e2ed35ab32a5fd9d (patch) | |
| tree | 88eee8ee654c760533973eeb48ff6e06e4bb6b63 /src/run | |
| parent | 07c802b93a241d566161d3077b3254df4067fa1e (diff) | |
| download | pish-e79adb55ac3b94bbdd40d8b6e2ed35ab32a5fd9d.tar.gz | |
clean up reload logic
Diffstat (limited to 'src/run')
| -rw-r--r-- | src/run/builtin.rs | 8 | ||||
| -rw-r--r-- | src/run/mod.rs | 5 |
2 files changed, 1 insertions, 12 deletions
diff --git a/src/run/builtin.rs b/src/run/builtin.rs index da6f4f2..5524fd7 100644 --- a/src/run/builtin.rs +++ b/src/run/builtin.rs @@ -43,13 +43,7 @@ impl Builtin for re { session.raw.disable(); match Command::new("cargo").arg("build").status() { Ok(status) if status.success() => { - // build of new shell succeeded - - // unwind the entire stack intentionally to free resources - // the catch handler will check the boolean and execve into - // the new executable - super::RELOAD.store(true, std::sync::atomic::Ordering::SeqCst); - std::panic::resume_unwind(Box::new(42)); + crate::reload::begin_reload(); } _ => (), } diff --git a/src/run/mod.rs b/src/run/mod.rs index 0000547..6484e30 100644 --- a/src/run/mod.rs +++ b/src/run/mod.rs @@ -2,17 +2,12 @@ use std::collections::HashMap; use std::fs; use std::os::unix::fs::PermissionsExt; use std::path::PathBuf; -#[cfg(debug_assertions)] -use std::sync::atomic::AtomicBool; use crate::parse::Ast; use crate::*; mod builtin; -#[cfg(debug_assertions)] -pub static RELOAD: AtomicBool = AtomicBool::new(false); - pub fn run(se: &mut Session, cmd: Vec<u8>) { let parsed = parse::do_parse(&cmd); |
