change the FileStore::is_open() to try to connect to the sock to tetermine if a FileStore is open instead of a PID file. because when deploying with docker a process with the same PID can be running (and often is the mize process itself)

This commit is contained in:
Sebastian Moser
2025-07-01 20:10:25 +02:00
parent 1ca2dcaf73
commit 85878f5707
4 changed files with 32 additions and 16 deletions

View File

@@ -1,3 +1,5 @@
use core::result::Result::Err;
use core::unimplemented;
use std::ffi::OsString;
use std::path::PathBuf;
use std::str::FromStr;
@@ -63,16 +65,8 @@ pub fn create(sub_matches: &ArgMatches) -> MizeResult<()> {
pub fn is_running(sub_matches: &ArgMatches) -> MizeResult<()> {
let home_dir = env!("HOME");
if FileStore::store_is_opened(home_dir.to_owned() + "/.mize")? {
println!("true");
} else {
println!("false");
}
Ok(())
println!("not implemented");
Err(mize_err!("not implemented"))
}