diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e83551a..9f6dfb5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,8 +56,8 @@ jobs: # args: "--target aarch64-apple-darwin" #- platform: "macos-latest" # for Intel based macs. # args: "--target x86_64-apple-darwin" - #- platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04. - # args: "" + - platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04. + args: "" - platform: "windows-latest" args: "" diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000..cbc0588 Binary files /dev/null and b/bun.lockb differ diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index ad819c3..3c49fe0 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -18,8 +18,10 @@ mod utils; use crate::autostart::is_autostart; use crate::autostart::set_autostart; use crate::utils::download_with_progress; +#[cfg(target_os = "windows")] use crate::utils::find_first_available_drive_letter; use crate::utils::is_winfsp_installed; +#[cfg(target_os = "windows")] use crate::utils::set_window_shadow; //use crate::localized::LANGUAGE_PACK; @@ -53,6 +55,7 @@ fn main() { download_file, get_autostart_state, set_autostart_state, + get_winfsp_install_state, get_available_drive_letter ]) @@ -121,9 +124,12 @@ fn run_command(cmd: &str) -> Result<(), Box> { Ok(()) } */ -#[cfg(target_os = "windows")] + #[tauri::command] fn get_winfsp_install_state() -> Result { + #[cfg(not(target_os = "windows"))] + return Ok(false); + #[cfg(target_os = "windows")] match is_winfsp_installed() { Ok(is_enabled) => Ok(is_enabled), Err(_) => Ok(false), @@ -158,9 +164,11 @@ fn download_file(url: String, out_path: String) -> Result { Ok(true) } -#[cfg(target_os = "windows")] #[tauri::command] fn get_available_drive_letter() -> Result { + #[cfg(not(target_os = "windows"))] + return Ok(String::from("")); + #[cfg(target_os = "windows")] match find_first_available_drive_letter() { Ok(Some(drive)) => Ok(drive), Ok(None) => Ok(String::from("")), diff --git a/src-tauri/src/utils.rs b/src-tauri/src/utils.rs index 767be82..3c603c7 100644 --- a/src-tauri/src/utils.rs +++ b/src-tauri/src/utils.rs @@ -7,12 +7,8 @@ use std::fs; use std::io::{self, Write}; //use tauri::AppHandle; +#[cfg(target_os = "windows")] pub fn set_window_shadow(app: &tauri::App) { - #[cfg(target_os = "linux")] - { - Ok() - } - #[cfg(target_os = "windows")] { let window = app.get_window("main").unwrap(); set_shadow(&window, true).expect("Unsupported platform!");