#[non_exhaustive]pub enum HookShell {
Bash,
Sh,
PowerShell,
}Expand description
Shell type for hook execution in update payloads.
Determines which shell interpreter and fail-early settings are used.
Marked #[non_exhaustive] because additional shell types (e.g. fish, zsh)
may be added in future releases. Downstream code must include a wildcard arm
when matching on this enum.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bash
Bash shell with set -euo pipefail
Sh
POSIX sh with set -eu
PowerShell
PowerShell with $ErrorActionPreference = 'Stop'
Implementations§
Source§impl HookShell
impl HookShell
Sourcepub const fn as_str(&self) -> &'static str
pub const fn as_str(&self) -> &'static str
Returns the string representation of the shell type.
Sourcepub fn local_executable(self) -> &'static str
pub fn local_executable(self) -> &'static str
Shell executable for the local machine (auto-detects platform).
PowerShell uses pwsh (PowerShell Core) on Linux/macOS because
powershell (Windows PowerShell 5.1) does not exist there.
Sourcepub fn remote_executable(self, remote_is_windows: bool) -> &'static str
pub fn remote_executable(self, remote_is_windows: bool) -> &'static str
Shell executable for a remote host.
Pass true when the remote host is Windows; false for Linux, macOS,
or any other non-Windows OS. SSH executors use this method because
local_executable() reflects the agent machine’s OS, not the target’s.
PowerShell: Windows → powershell, non-Windows → pwsh.
Trait Implementations§
impl Copy for HookShell
Source§impl<'de> Deserialize<'de> for HookShell
impl<'de> Deserialize<'de> for HookShell
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HookShell, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HookShell, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for HookShell
Source§impl Serialize for HookShell
impl Serialize for HookShell
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for HookShell
Auto Trait Implementations§
impl Freeze for HookShell
impl RefUnwindSafe for HookShell
impl Send for HookShell
impl Sync for HookShell
impl Unpin for HookShell
impl UnsafeUnpin for HookShell
impl UnwindSafe for HookShell
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.