mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-11-19 21:41:07 +01: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 cmd_alias_arr
|
||||
local cmd_alias
|
||||
local return_value
|
||||
while (($#)); do
|
||||
case "$1" in
|
||||
command|exec|-) shift; break ;;
|
||||
|
@ -43,8 +44,10 @@ function _do_sudo() {
|
|||
else
|
||||
PATH="/sbin:/usr/sbin:/usr/local/sbin:$PATH" command sudo "${args[@]}" $==*
|
||||
fi
|
||||
return_value=$?
|
||||
unset __do_sudo_glob
|
||||
unset __do_sudo_expanded
|
||||
return $return_value
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue