精简init

This commit is contained in:
HouXiaoxuan
2023-12-17 18:53:04 +08:00
parent 64fbfd178c
commit f3cfb559b5

View File

@@ -39,18 +39,7 @@ fn set_dir_hidden(dir: &str) -> io::Result<()> {
Ok(())
}
#[cfg(target_os = "linux")]
fn set_dir_hidden(dir: &str) -> io::Result<()> { //linux下以'.'开头就已经是隐藏文件(夹)了
#[cfg( not(target_os = "windows"))]
fn set_dir_hidden(dir: &str) -> io::Result<()> { //类unix系统下'.'开头就已经是隐藏文件(夹)了
Ok(())
}
#[cfg(target_os = "macos")]
fn set_dir_hidden(dir: &str) -> io::Result<()> {
use std::process::Command;
Command::new("chflags")
.arg("hidden")
.arg(dir)
.spawn()?
.wait()?;
Ok(())
}