From 8f5b2b4a0e52fd96f95e8a0de03a49b670a800b6 Mon Sep 17 00:00:00 2001
From: GyDi <segydi@foxmail.com>
Date: Tue, 11 Jan 2022 23:14:43 +0800
Subject: [PATCH] chore: add macos startup todo

---
 src-tauri/src/utils/startup.rs | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/src-tauri/src/utils/startup.rs b/src-tauri/src/utils/startup.rs
index f2d8266..224e795 100644
--- a/src-tauri/src/utils/startup.rs
+++ b/src-tauri/src/utils/startup.rs
@@ -3,9 +3,9 @@ use std::path::PathBuf;
 
 static APP_KEY: &str = "ClashVerge";
 
-#[cfg(target_os = "windows")]
 /// get the startup value
 /// whether as same as the exe_path
+#[cfg(target_os = "windows")]
 pub fn get_startup(exe_path: &PathBuf) -> io::Result<bool> {
   use winreg::enums::*;
   use winreg::RegKey;
@@ -26,9 +26,9 @@ pub fn get_startup(exe_path: &PathBuf) -> io::Result<bool> {
   }
 }
 
-#[cfg(target_os = "windows")]
 /// set the startup on windows
 /// delete the reg key if disabled
+#[cfg(target_os = "windows")]
 pub fn set_startup(enable: bool, exe_path: &PathBuf) -> io::Result<()> {
   use winreg::enums::*;
   use winreg::RegKey;
@@ -49,6 +49,18 @@ pub fn set_startup(enable: bool, exe_path: &PathBuf) -> io::Result<()> {
   }
 }
 
+/// todo
+#[cfg(target_os = "macos")]
+pub fn get_startup(exe_path: &PathBuf) -> io::Result<bool> {
+  Ok(true)
+}
+
+/// todo
+#[cfg(target_os = "macos")]
+pub fn set_startup(enable: bool, exe_path: &PathBuf) -> io::Result<()> {
+  Ok(())
+}
+
 #[cfg(target_os = "windows")]
 #[test]
 fn test() {
-- 
GitLab