mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
refactor(shell)!: remove deprecated open API (#3604)
* refactor(shell)!: remove deprecated open API `open` has been deprecated since 2.1.0 in favor of tauri-plugin-opener. This removes: - the `open` command and its `allow-open`/`deny-open` permissions (`shell:default` now grants nothing) - the `plugins > shell > open` configuration; `init()` returns `TauriPlugin<R>` again - `Shell::open`, the `tauri_plugin_shell::open` module and `Error::UnknownProgramName` - the `open` JavaScript function - the Android and iOS plugins, since `open` was their only command * chore(examples): drop the now empty shell:default permission set --------- Co-authored-by: Lucas Nogueira <lucas@crabnebula.dev>
This commit is contained in:
co-authored by
Lucas Nogueira
parent
6a12f7c80a
commit
152ff5bb6d
+1
-17
@@ -163,7 +163,7 @@ fn _f() {
|
||||
};
|
||||
}
|
||||
|
||||
const COMMANDS: &[&str] = &["execute", "spawn", "stdin_write", "kill", "open"];
|
||||
const COMMANDS: &[&str] = &["execute", "spawn", "stdin_write", "kill"];
|
||||
|
||||
fn main() {
|
||||
tauri_plugin::Builder::new(COMMANDS)
|
||||
@@ -172,21 +172,5 @@ fn main() {
|
||||
schemars::SchemaGenerator::new(schemars::generate::SchemaSettings::draft07())
|
||||
.into_root_schema_for::<ShellScopeEntry>(),
|
||||
)
|
||||
.android_path("android")
|
||||
.ios_path("ios")
|
||||
.build();
|
||||
|
||||
let target_os = std::env::var("CARGO_CFG_TARGET_OS").unwrap();
|
||||
let mobile = target_os == "ios" || target_os == "android";
|
||||
alias("desktop", !mobile);
|
||||
alias("mobile", mobile);
|
||||
}
|
||||
|
||||
// creates a cfg alias if `has_feature` is true.
|
||||
// `alias` must be a snake case string.
|
||||
fn alias(alias: &str, has_feature: bool) {
|
||||
println!("cargo:rustc-check-cfg=cfg({alias})");
|
||||
if has_feature {
|
||||
println!("cargo:rustc-cfg={alias}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user