Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
Attempt to remove previous when starting the server
Browse files Browse the repository at this point in the history
  • Loading branch information
robem committed Apr 17, 2024
1 parent 472e81c commit 4bf7848
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions kak-tree-sitter/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,22 +74,9 @@ impl Server {
log::debug!("kak-tree-sitter already running; not starting a new server");
return Ok(());
} else {
log::debug!("removing previous PID file");
std::fs::remove_file(&pid_file).map_err(|err| OhNo::CannotStartDaemon {
err: format!(
"cannot remove previous PID file {path}: {err}",
path = pid_file.display()
),
})?;

log::debug!("removing previous socket file");
let socket_file = runtime_dir.join("socket");
std::fs::remove_file(&socket_file).map_err(|err| OhNo::CannotStartDaemon {
err: format!(
"cannot remove previous socket file {path}: {err}",
path = socket_file.display()
),
})?;
log::debug!("removing previous state");
// If there is no previous state then ignore
let _ = fs::remove_dir_all(&runtime_dir);
}
}

Expand Down

0 comments on commit 4bf7848

Please sign in to comment.