mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-27 08:10:08 +00:00
preserve exit code
This commit is contained in:
parent
aad3bb04a8
commit
4de06d21e0
1 changed files with 3 additions and 0 deletions
|
@ -10,6 +10,7 @@ function _do_sudo() {
|
||||||
local -a args
|
local -a args
|
||||||
local -a cmd_alias_arr
|
local -a cmd_alias_arr
|
||||||
local cmd_alias
|
local cmd_alias
|
||||||
|
local return_value
|
||||||
while (($#)); do
|
while (($#)); do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
command|exec|-) shift; break ;;
|
command|exec|-) shift; break ;;
|
||||||
|
@ -43,8 +44,10 @@ function _do_sudo() {
|
||||||
else
|
else
|
||||||
PATH="/sbin:/usr/sbin:/usr/local/sbin:$PATH" command sudo "${args[@]}" $==*
|
PATH="/sbin:/usr/sbin:/usr/local/sbin:$PATH" command sudo "${args[@]}" $==*
|
||||||
fi
|
fi
|
||||||
|
return_value=$?
|
||||||
unset __do_sudo_glob
|
unset __do_sudo_glob
|
||||||
unset __do_sudo_expanded
|
unset __do_sudo_expanded
|
||||||
|
return $return_value
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue