mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2025-12-06 07:20:40 +01:00
fix(magic-enter): check for cmd existance before executing
Closes #13294
This commit is contained in:
@@ -10,9 +10,10 @@ magic-enter() {
|
||||
return
|
||||
fi
|
||||
|
||||
if command jj st >/dev/null 2>&1; then # needs to be before git to handle colocated repositories
|
||||
# needs to be before git to handle colocated repositories
|
||||
if (( $+commands[jj] )) && command jj st >/dev/null 2>&1; then
|
||||
BUFFER="$MAGIC_ENTER_JJ_COMMAND"
|
||||
elif command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
elif (( $+commands[git] )) && command git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
||||
BUFFER="$MAGIC_ENTER_GIT_COMMAND"
|
||||
else
|
||||
BUFFER="$MAGIC_ENTER_OTHER_COMMAND"
|
||||
|
||||
Reference in New Issue
Block a user