Skip to content

Commit

Permalink
Add support for zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
tehrengruber committed Jul 9, 2024
1 parent cd738e8 commit 802dab4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions activate
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# only run if bash or zsh
[ -n "${BASH_VERSION:-}" ] || return 0
[ -n "${BASH_VERSION:-}" ] || [ -n "${ZSH_VERSION:-}" ] || return 0

export UENV_CMD='env -u PYTHONPATH -u VIRTUAL_ENV @@impl@@'
export UENV_IMG_CMD='env -u PYTHONPATH -u VIRTUAL_ENV @@image_impl@@'
Expand Down Expand Up @@ -49,16 +49,16 @@ function uenv {
uenv_usage;
elif [ "$1" = "image" ]; then
shift;
$UENV_IMG_CMD $flags "$@"
eval $UENV_IMG_CMD $flags "$@"
elif [[ " $* " =~ [[:space:]](-h|--help)[[:space:]] ]]; then
echo "$($UENV_CMD $flags "$@")"
echo "$(eval $UENV_CMD $flags "$@")"
else
eval "$($UENV_CMD $flags "$@")"
eval "$(eval $UENV_CMD $flags "$@")"
fi
fi

unset -f uenv_usage
return $_exitcode
}

export -f uenv
[ -n "${BASH_VERSION:-}" ] && export -f uenv

0 comments on commit 802dab4

Please sign in to comment.