From 8f5188c8a20d184a3cf1a41f6e3c8a2f7239480c Mon Sep 17 00:00:00 2001 From: Noah Klayman Date: Thu, 11 Feb 2021 21:25:12 -0800 Subject: [PATCH] fix(bundler): remove unused code --- cli/tauri-bundler/src/bundle.rs | 36 ++++++++++++++--------------- cli/tauri-bundler/src/bundle/wix.rs | 4 +--- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/cli/tauri-bundler/src/bundle.rs b/cli/tauri-bundler/src/bundle.rs index f8ace1705..22f8e59cc 100644 --- a/cli/tauri-bundler/src/bundle.rs +++ b/cli/tauri-bundler/src/bundle.rs @@ -65,27 +65,25 @@ pub fn bundle_project(settings: Settings) -> crate::Result> { #[cfg(windows)] { - if let Ok(tauri_config) = get_tauri_config() { - let exempt_output = Command::new("CheckNetIsolation") - .args(&vec!["LoopbackExempt", "-s"]) - .output() - .expect("failed to read LoopbackExempt -s"); + let exempt_output = Command::new("CheckNetIsolation") + .args(&vec!["LoopbackExempt", "-s"]) + .output() + .expect("failed to read LoopbackExempt -s"); - if !exempt_output.status.success() { - panic!("Failed to execute CheckNetIsolation LoopbackExempt -s"); - } + if !exempt_output.status.success() { + panic!("Failed to execute CheckNetIsolation LoopbackExempt -s"); + } - let output_str = String::from_utf8_lossy(&exempt_output.stdout).to_lowercase(); - if !output_str.contains("win32webviewhost_cw5n1h2txyewy") { - println!("Running Loopback command"); - runas::Command::new("powershell") - .args(&[ - "CheckNetIsolation LoopbackExempt -a -n=\"Microsoft.Win32WebViewHost_cw5n1h2txyewy\"", - ]) - .force_prompt(true) - .status() - .expect("failed to run Loopback command"); - } + let output_str = String::from_utf8_lossy(&exempt_output.stdout).to_lowercase(); + if !output_str.contains("win32webviewhost_cw5n1h2txyewy") { + println!("Running Loopback command"); + runas::Command::new("powershell") + .args(&[ + "CheckNetIsolation LoopbackExempt -a -n=\"Microsoft.Win32WebViewHost_cw5n1h2txyewy\"", + ]) + .force_prompt(true) + .status() + .expect("failed to run Loopback command"); } } diff --git a/cli/tauri-bundler/src/bundle/wix.rs b/cli/tauri-bundler/src/bundle/wix.rs index 3c88c6018..00c13d7e8 100644 --- a/cli/tauri-bundler/src/bundle/wix.rs +++ b/cli/tauri-bundler/src/bundle/wix.rs @@ -449,9 +449,7 @@ pub fn build_wix_app_installer( let mut data = BTreeMap::new(); - if let Ok(tauri_config) = crate::bundle::tauri_config::get() { - data.insert("embedded_server", to_json(true)); - } + data.insert("embedded_server", to_json(true)); data.insert("product_name", to_json(settings.bundle_name())); data.insert("version", to_json(settings.version_string()));