diff --git a/src/shims.rs b/src/shims.rs index 4b102d2..3c54484 100644 --- a/src/shims.rs +++ b/src/shims.rs @@ -12,13 +12,17 @@ use crate::metadata; fn create_shim(binary: &str, bin_path: path::PathBuf) -> Result<()> { use std::os::unix::prelude::OpenOptionsExt; - let shell = env::var("SHELL") + let mut shell = env::var("SHELL") .unwrap_or("bash".to_string()) .split('/') .last() .unwrap() .to_string(); + if !vec!["bash", "zsh", "sh"].contains(&&*shell) { + shell = "sh".to_string(); + } + let script = format!( r#"#!/usr/bin/env {shell}