From ede0c686224c859ade8b0ad92d1294966b487d04 Mon Sep 17 00:00:00 2001 From: Krzysztof Andrelczyk Date: Fri, 7 Mar 2025 20:33:00 +0100 Subject: [PATCH] fix windows build --- .../updater/tests/app-updater/tests/update.rs | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/plugins/updater/tests/app-updater/tests/update.rs b/plugins/updater/tests/app-updater/tests/update.rs index 58e9594e..8c308bb3 100644 --- a/plugins/updater/tests/app-updater/tests/update.rs +++ b/plugins/updater/tests/app-updater/tests/update.rs @@ -46,7 +46,7 @@ struct Update { platforms: HashMap, } -fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, targets: Vec) { +fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, target: BundleTarget) { let mut command = Command::new("cargo"); command .args(["tauri", "build", "--debug", "--verbose"]) @@ -56,21 +56,19 @@ fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, targets: Vec>()); + command.args(["--bundles", target.name()]); #[cfg(target_os = "macos")] - command.args([target.name()]); + command.args(["--bundles", target.name()]); if bundle_updater { #[cfg(windows)] - command.args(["msi", "nsis"]); - - command.args(["updater"]); + command.args(["--bundles", "msi", "nsis"]); } else { #[cfg(windows)] - command.args([target.name()]); + command.args(["--bundles", target.name()]); } + let status = command .status() .expect("failed to run Tauri CLI to bundle app"); @@ -80,6 +78,7 @@ fn build_app(cwd: &Path, config: &Config, bundle_updater: bool, targets: Vec Vec { + fn default() -> Self { #[cfg(any(target_os = "macos", target_os = "ios"))] - return vec![Self::App]; + return Self::App; #[cfg(target_os = "linux")] - return vec![Self::AppImage]; + return Self::AppImage; #[cfg(windows)] - return vec![Self::Nsis]; + return Self::Nsis; } } @@ -267,7 +266,7 @@ fn update_app() { { // bundle app update config.version = "1.0.0"; - build_app(&manifest_dir, &config, true, BundleTarget::get_targets()); + build_app(&manifest_dir, &config, true, BundleTarget::default()); let bundle_updater_ext = if v1_compatible { out_bundle_path @@ -350,7 +349,7 @@ fn update_app() { config.version = "0.1.0"; // bundle initial app version - build_app(&manifest_dir, &config, false, vec![bundle_target]); + build_app(&manifest_dir, &config, false, bundle_target); for expected_exit_code in status_checks { let mut binary_cmd = if cfg!(windows) {