From 58c994ce1ca814e5c5bf9533d19bda205416be09 Mon Sep 17 00:00:00 2001 From: amrbashir Date: Thu, 9 May 2024 23:45:37 +0300 Subject: [PATCH 1/2] fix(core): fix compilation when `shell-execute` or `shell-sidecar` regression from: https://github.com/tauri-apps/tauri/pull/9706 --- core/tauri/src/endpoints/shell.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/tauri/src/endpoints/shell.rs b/core/tauri/src/endpoints/shell.rs index 90d8db63e444..f1a8ef27b16e 100644 --- a/core/tauri/src/endpoints/shell.rs +++ b/core/tauri/src/endpoints/shell.rs @@ -110,7 +110,8 @@ impl Cmd { let encoding = options .encoding .as_ref() - .and_then(|encoding| crate::api::process::Encoding::for_label(encoding.as_bytes())); + .and_then(|encoding| encoding_rs::Encoding::for_label(encoding.as_bytes())); + let command = prepare_cmd(&context, &program, args, options)?; let mut command: std::process::Command = command.into(); @@ -222,6 +223,7 @@ impl Cmd { } } +#[cfg(any(shell_execute, shell_sidecar))] fn prepare_cmd( context: &InvokeContext, program: &String, @@ -287,7 +289,7 @@ fn prepare_cmd( command = command.env_clear(); } if let Some(encoding) = &options.encoding { - if let Some(encoding) = crate::api::process::Encoding::for_label(encoding.as_bytes()) { + if let Some(encoding) = encoding_rs::Encoding::for_label(encoding.as_bytes()) { command = command.encoding(encoding); } else { return Err(anyhow::anyhow!(format!("unknown encoding {encoding}"))); From 3a7bbfb1a42c856375368c93df02074a77a99047 Mon Sep 17 00:00:00 2001 From: Amr Bashir Date: Thu, 9 May 2024 23:48:29 +0300 Subject: [PATCH 2/2] change file --- .changes/shell-execute.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changes/shell-execute.md diff --git a/.changes/shell-execute.md b/.changes/shell-execute.md new file mode 100644 index 000000000000..1f014e0a5b8e --- /dev/null +++ b/.changes/shell-execute.md @@ -0,0 +1,5 @@ +--- +"tauri": "patch:bug" +--- + +Fix compilation error when `shell-execute` or `shell-sidecar` features are not active \ No newline at end of file