Skip to content

Commit

Permalink
Merge pull request #425 from ap/shellish
Browse files Browse the repository at this point in the history
Some small zsh/bash code improvements
  • Loading branch information
gugod committed Nov 15, 2014
2 parents 60f01fc + 732eba6 commit 82c301c
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions lib/App/perlbrew.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2443,12 +2443,7 @@ __perlbrew_reinit() {
__perlbrew_purify () {
local path patharray outsep
if [[ -n "$BASH_VERSION" ]]; then
IFS=: read -ra patharray <<< "$1"
fi
if [[ -n "$ZSH_VERSION" ]]; then
IFS=: read -rA patharray <<< "$1"
fi
IFS=: read -r${BASH_VERSION+a}${ZSH_VERSION+A} patharray <<< "$1"
for path in ${patharray[@]} ; do
case "$path" in
(*"$PERLBREW_HOME"*) ;;
Expand All @@ -2471,12 +2466,7 @@ __perlbrew_set_env() {
}
__perlbrew_activate() {
if [[ -n "$BASH_VERSION" ]]; then
[[ $(type -t perl) == alias ]] && unalias perl 2> /dev/null
fi
if [[ -n "$ZSH_VERSION" ]]; then
[[ -n $(alias perl 2>/dev/null) ]] && unalias perl 2>/dev/null
fi
[[ -n $(alias perl 2>/dev/null) ]] && unalias perl 2>/dev/null
if [[ -n "$PERLBREW_PERL" ]]; then
__perlbrew_set_env "$PERLBREW_PERL${PERLBREW_LIB:+@}$PERLBREW_LIB"
Expand Down Expand Up @@ -2507,11 +2497,7 @@ perlbrew () {
case $1 in
(use)
if [[ -z "$2" ]] ; then
if [[ -z "$PERLBREW_PERL" ]] ; then
echo "Currently using system perl"
else
echo "Currently using $PERLBREW_PERL"
fi
echo "Currently using ${PERLBREW_PERL:-system perl}"
else
__perlbrew_set_env "$2"
exit_status="$?"
Expand Down

0 comments on commit 82c301c

Please sign in to comment.