fix(core): feature flag usage on the shell APIs

This commit is contained in:
Lucas Nogueira 2022-02-04 16:28:11 -03:00
parent 4e6308c296
commit a434393413
No known key found for this signature in database
GPG Key ID: 2714B66BCFB01F7F
2 changed files with 6 additions and 6 deletions

View File

@ -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);

View File

@ -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")))