Browse Source

Fix(core): import regex if shell-open is enabled. (#3339)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Fabian-Lars 3 years ago
parent
commit
7d2a6d8055
3 changed files with 4 additions and 4 deletions
  1. 2 2
      core/tauri-codegen/Cargo.toml
  2. 1 1
      core/tauri/build.rs
  3. 1 1
      core/tauri/src/lib.rs

+ 2 - 2
core/tauri-codegen/Cargo.toml

@@ -24,12 +24,12 @@ tauri-utils = { version = "1.0.0-beta.3", path = "../tauri-utils", features = [
 thiserror = "1"
 walkdir = "2"
 zstd = { version = "0.10", optional = true }
-regex = "1"
+regex = { version = "1", optional = true }
 uuid = { version = "0.8", features = [ "v4" ] }
 
 [features]
 default = [ "compression" ]
 compression = [ "zstd", "tauri-utils/compression" ]
 isolation = ["tauri-utils/isolation"]
-shell-scope = []
+shell-scope = ["regex"]
 config-json5 = [ "tauri-utils/config-json5" ]

+ 1 - 1
core/tauri/build.rs

@@ -56,7 +56,7 @@ fn main() {
     shell_sidecar: { any(shell_all, feature = "shell-sidecar") },
     shell_open: { any(shell_all, feature = "shell-open") },
     // helper for the shell scope functionality
-    shell_scope: { any(shell_execute, shell_open, shell_sidecar, feature = "shell-open-api") },
+    shell_scope: { any(shell_execute, shell_sidecar, feature = "shell-open-api") },
 
     // dialog
     dialog_all: { any(api_all, feature = "dialog-all") },

+ 1 - 1
core/tauri/src/lib.rs

@@ -133,7 +133,7 @@
 pub use embed_plist;
 /// The Tauri error enum.
 pub use error::Error;
-#[cfg(feature = "shell-execute")]
+#[cfg(shell_scope)]
 #[doc(hidden)]
 pub use regex;
 pub use tauri_macros::{command, generate_handler};