Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,15 @@ fn run_command(command: &str, shell: &str) -> Result<()> {
anyhow::bail!("Invalid shell configuration");
}

let command = format!("shopt -s extglob globstar nullglob\n{command}");
let shell_name = shell_parts.last().unwrap();

// Only add shopt for bash and zsh (which support it)
// Fish, sh, and other shells don't support shopt
let command = if shell_name.contains("bash") || shell_name.contains("zsh") {
format!("shopt -s extglob globstar nullglob\n{command}")
} else {
command.to_string()
};

let status = if shell_parts.len() == 1 {
Command::new(shell_parts[0])
Expand Down
Loading