mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-12-15 21:53:59 +03:00
fix(core): feature flag usage on the shell APIs
This commit is contained in:
parent
4e6308c296
commit
a434393413
@ -4,7 +4,7 @@
|
||||
|
||||
use super::InvokeContext;
|
||||
use crate::{api::ipc::CallbackFn, Runtime};
|
||||
#[cfg(shell_execute)]
|
||||
#[cfg(shell_scope)]
|
||||
use crate::{Manager, Scopes};
|
||||
use serde::Deserialize;
|
||||
use tauri_macros::{module_command_handler, CommandModule};
|
||||
@ -14,15 +14,15 @@ use crate::ExecuteArgs;
|
||||
#[cfg(not(shell_scope))]
|
||||
type ExecuteArgs = ();
|
||||
|
||||
#[cfg(shell_execute)]
|
||||
#[cfg(any(shell_execute, shell_sidecar))]
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::{collections::HashMap, path::PathBuf};
|
||||
|
||||
type ChildId = u32;
|
||||
#[cfg(shell_execute)]
|
||||
#[cfg(any(shell_execute, shell_sidecar))]
|
||||
type ChildStore = Arc<Mutex<HashMap<ChildId, crate::api::process::CommandChild>>>;
|
||||
|
||||
#[cfg(shell_execute)]
|
||||
#[cfg(any(shell_execute, shell_sidecar))]
|
||||
fn command_childs() -> &'static ChildStore {
|
||||
use once_cell::sync::Lazy;
|
||||
static STORE: Lazy<ChildStore> = Lazy::new(Default::default);
|
||||
|
@ -166,7 +166,7 @@ pub enum ScopeError {
|
||||
MissingVar(String),
|
||||
|
||||
/// At least one argument did not pass input validation.
|
||||
#[cfg(any(shell_execute, shell_open))]
|
||||
#[cfg(shell_scope)]
|
||||
#[cfg_attr(
|
||||
doc_cfg,
|
||||
doc(cfg(any(feature = "shell-execute", feature = "shell-open")))
|
||||
@ -193,7 +193,7 @@ pub enum ScopeError {
|
||||
InvalidInput(String),
|
||||
|
||||
/// A generic IO error that occurs while executing specified shell commands.
|
||||
#[cfg(any(shell_execute, shell_sidecar))]
|
||||
#[cfg(shell_scope)]
|
||||
#[cfg_attr(
|
||||
doc_cfg,
|
||||
doc(cfg(any(feature = "shell-execute", feature = "shell-sidecar")))
|
||||
|
Loading…
Reference in New Issue
Block a user