From 03583a3b517b19b0c813083327d2c6512d33b0a7 Mon Sep 17 00:00:00 2001 From: VirtualHotBar <96966978+VirtualHotBar@users.noreply.github.com> Date: Sat, 4 May 2024 22:32:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=B9=B3=E5=8F=B0=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 8 ++++---- src-tauri/src/main.rs | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9a89b77..c472701 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -93,9 +93,9 @@ jobs: path: | ~/.pnpm-store node_modules - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + key: ${{ runner.os }}-${{ runner.arch}}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} restore-keys: | - ${{ runner.os }}-pnpm- + ${{ runner.os }}-${{ runner.arch}}-pnpm- - name: install frontend dependencies run: pnpm install @@ -106,9 +106,9 @@ jobs: path: | ~/.cargo/registry src-tauri/target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/src-tauri/Cargo.lock') }} + key: ${{ runner.os }}-${{ runner.arch}}cargo-${{ hashFiles('**/src-tauri/Cargo.lock') }} restore-keys: | - ${{ runner.os }}-cargo- + ${{ runner.os }}-${{ runner.arch}}-cargo- - uses: tauri-apps/tauri-action@v0 env: diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 192b02c..d8ccb54 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -142,18 +142,20 @@ fn get_winfsp_install_state() -> Result { #[tauri::command] fn get_autostart_state() -> Result { + #[cfg(target_os = "macos")] + Ok(false); - #[cfg(not(target_os = "macos"))] match is_autostart() { - Ok(is_enabled) => is_enabled, - Err(_) => false, + Ok(is_enabled) => Ok(is_enabled), + Err(_) => Ok(false), } - Ok(false) } #[tauri::command] fn set_autostart_state(enabled: bool) -> Result<(), ()> { - #[cfg(not(target_os = "macos"))] + #[cfg(target_os = "macos")] + Ok(()); + let _ = set_autostart(enabled); Ok(()) }