Return Windows binary exit code instead of 0

This commit is contained in:
Rinyre 2017-05-13 16:11:37 -05:00
parent 06c6a3d0ad
commit 74a0a71631

View File

@ -39,13 +39,13 @@ case "$SYS_KERNEL" in
*WSL*|*Microsoft*) command_not_found_handler () { *WSL*|*Microsoft*) command_not_found_handler () {
commandsent="$@" commandsent="$@"
buffer=("${(@s/ /)commandsent}") buffer=("${(@s/ /)commandsent}")
which $buffer[1].exe>/dev/null which $buffer[1].exe>/dev/null # Does binary exist in path?
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
buffer[1]=$buffer[1].exe buffer[1]=$buffer[1].exe
$buffer $buffer
return 0 exit # Returns exit code from Windows binary
else else
return 1 return 1 # Returns 'command not found'
fi fi
} ;; } ;;
*) ;; *) ;;