From f3cfb559b56f942273d30c65a375275e9e78f6fc Mon Sep 17 00:00:00 2001 From: HouXiaoxuan Date: Sun, 17 Dec 2023 18:53:04 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E7=AE=80init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/commands/init.rs | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/commands/init.rs b/src/commands/init.rs index 2921985..deca19b 100644 --- a/src/commands/init.rs +++ b/src/commands/init.rs @@ -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(()) -} \ No newline at end of file