Skip to content

Commit

Permalink
Fixes infinite loop in auto install not found bash function
Browse files Browse the repository at this point in the history
This infinite loop bug is triggered when mise itself becomes not found, e.g., by deleting the directory mise is in.
  • Loading branch information
bnorick committed Jan 14, 2025
1 parent 801a880 commit 0b42ee9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shell/bash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl Shell for Bash {
{chpwd_load}
chpwd_functions+=(_mise_hook)
_mise_hook
"#,
"#,
chpwd_functions = include_str!("../assets/bash_zsh_support/chpwd/function.sh"),
chpwd_load = include_str!("../assets/bash_zsh_support/chpwd/load.sh")
});
Expand All @@ -71,7 +71,7 @@ impl Shell for Bash {
fi
command_not_found_handle() {{
if {exe} hook-not-found -s bash -- "$1"; then
if [ "$1" != "mise" ] && {exe} hook-not-found -s bash -- "$1"; then
_mise_hook
"$@"
elif [ -n "$(declare -f _command_not_found_handle)" ]; then
Expand Down

0 comments on commit 0b42ee9

Please sign in to comment.