Skip to content

Commit

Permalink
preserve exit status more idiomatically (for bash)
Browse files Browse the repository at this point in the history
  • Loading branch information
ap committed Nov 11, 2015
1 parent 2e056a4 commit 6cfc249
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/App/perlbrew.pm
Expand Up @@ -2503,24 +2503,17 @@ perlbrew () {
[ -n "$PERLBREW_LIB" ] && echo -n "@$PERLBREW_LIB"
echo
else
__perlbrew_set_env "$2"
__perlbrew_set_env "$2" && { __perlbrew_set_path ; true ; }
exit_status="$?"
if [[ $exit_status -eq 0 ]]
then
__perlbrew_set_path
fi
fi
;;
(switch)
if [[ -z "$2" ]] ; then
command perlbrew switch
else
perlbrew use $2
perlbrew use $2 && { __perlbrew_reinit $2 ; true ; }
exit_status=$?
if [[ ${exit_status} -eq 0 ]]; then
__perlbrew_reinit $2
fi
fi
;;
Expand Down

0 comments on commit 6cfc249

Please sign in to comment.