diff options
Diffstat (limited to 'ui')
| -rw-r--r-- | ui/backend/src/install.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ui/backend/src/install.rs b/ui/backend/src/install.rs index 55877c4b..43ad0c54 100644 --- a/ui/backend/src/install.rs +++ b/ui/backend/src/install.rs @@ -23,9 +23,14 @@ pub(crate) async fn install_cli() -> Result<(), String> { #[tauri::command] pub(crate) async fn is_cli_installed() -> Result<bool, String> { let shell = Shell::default_shell().map_err(|e| format!("Failed to get default shell: {e}"))?; - let output = shell - .run_interactive(&["atuin --version && echo 'ATUIN FOUND'"]) - .map_err(|e| format!("Failed to run interactive command"))?; + let output = if shell == Shell::Powershell { + shell.run_interactive(&["atuin --version; if ($?) {echo 'ATUIN FOUND'}"]) + .map_err(|e| format!("Failed to run interactive command"))? + } else { + shell + .run_interactive(&["atuin --version && echo 'ATUIN FOUND'"]) + .map_err(|e| format!("Failed to run interactive command"))? + }; Ok(output.contains("ATUIN FOUND")) } |
