init macos support

This commit is contained in:
HouXiaoxuan
2023-12-17 18:33:33 +08:00
parent 03d5c815f2
commit c78ac18e10
2 changed files with 12 additions and 0 deletions

1
git-rs Submodule

Submodule git-rs added at 5f3bb36574

View File

@@ -42,4 +42,15 @@ fn set_dir_hidden(dir: &str) -> io::Result<()> {
#[cfg(target_os = "linux")]
fn set_dir_hidden(dir: &str) -> io::Result<()> { //linux下以'.'开头就已经是隐藏文件(夹)了
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(())
}