#[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.