Switch to open based restarting

This commit is contained in:
Mikayla Maki
2023-02-16 16:47:43 -08:00
parent 4ea7a24b93
commit 6e33f33da1
8 changed files with 44 additions and 46 deletions
-1
View File
@@ -18,7 +18,6 @@ clap = { version = "3.1", features = ["derive"] }
dirs = "3.0"
ipc-channel = "0.16"
serde = { version = "1.0", features = ["derive", "rc"] }
sysinfo = "0.27"
[target.'cfg(target_os = "macos")'.dependencies]
core-foundation = "0.9"
+1 -12
View File
@@ -14,10 +14,8 @@ use std::{
fs::{self, OpenOptions},
io,
path::{Path, PathBuf},
ptr, thread,
time::Duration,
ptr,
};
use sysinfo::{Pid, System, SystemExt};
#[derive(Parser)]
#[clap(name = "zed", global_setting(clap::AppSettings::NoAutoVersion))]
@@ -34,8 +32,6 @@ struct Args {
/// Custom Zed.app path
#[clap(short, long)]
bundle_path: Option<PathBuf>,
#[clap(short, long)]
restart_from: Option<Pid>,
}
#[derive(Debug, Deserialize)]
@@ -64,13 +60,6 @@ fn main() -> Result<()> {
return Ok(());
}
if let Some(parent_pid) = args.restart_from {
let mut system = System::new();
while system.refresh_process(parent_pid) {
thread::sleep(Duration::from_millis(100));
}
}
for path in args.paths.iter() {
if !path.exists() {
touch(path.as_path())?;