diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-09 21:43:23 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-07-09 21:43:23 +0200 |
| commit | 3223d93cb3c77ab02aa0a35f2a8314e447cee9a4 (patch) | |
| tree | 3971a1f37f5fe3cadb747c5229a0d54e868e45e3 /crates/turtle/src/atuin_common/shell.rs | |
| parent | fix(client/sync): Pass through precise error on `SyncError::WrongKey` (diff) | |
| download | atuin-3223d93cb3c77ab02aa0a35f2a8314e447cee9a4.zip | |
chore: Separate daemon, client, server, and lib into crates
Diffstat (limited to 'crates/turtle/src/atuin_common/shell.rs')
| -rw-r--r-- | crates/turtle/src/atuin_common/shell.rs | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/crates/turtle/src/atuin_common/shell.rs b/crates/turtle/src/atuin_common/shell.rs deleted file mode 100644 index 880ff00f..00000000 --- a/crates/turtle/src/atuin_common/shell.rs +++ /dev/null @@ -1,52 +0,0 @@ -#[derive(PartialEq)] -pub(crate) enum Shell { - Sh, - Bash, - Fish, - Zsh, - Xonsh, - Nu, - Powershell, - - Unknown, -} - -impl std::fmt::Display for Shell { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - let shell = match self { - Self::Bash => "bash", - Self::Fish => "fish", - Self::Zsh => "zsh", - Self::Nu => "nu", - Self::Xonsh => "xonsh", - Self::Sh => "sh", - Self::Powershell => "powershell", - - Self::Unknown => "unknown", - }; - - write!(f, "{shell}") - } -} - -impl Shell { - pub(crate) fn from_env() -> Self { - std::env::var("ATUIN_SHELL").map_or(Self::Unknown, |shell| { - Self::from_string(shell.trim().to_lowercase().as_str()) - }) - } - - pub(crate) fn from_string(name: &str) -> Self { - match name { - "bash" => Self::Bash, - "fish" => Self::Fish, - "zsh" => Self::Zsh, - "xonsh" => Self::Xonsh, - "nu" => Self::Nu, - "sh" => Self::Sh, - "powershell" => Self::Powershell, - - _ => Self::Unknown, - } - } -} |
