From 43890f70adfe78b5a436252323357732efb5a432 Mon Sep 17 00:00:00 2001 From: Patrick Baker Date: Tue, 18 Feb 2014 21:19:02 -0500 Subject: [PATCH] Clean up perlbrew logic and allow for proper expansion --- modules/perl/init.zsh | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index 82095633..9c4fdf7c 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -3,18 +3,27 @@ # # Authors: # Sorin Ionescu +# Patrick Baker # -# Return if requirements are not found. -if (( ! $+commands[perl] )); then - return 1 +# +# Perlbrew +# +zstyle -s ':prezto:module:perl:perlbrew' location '_perlbrew_root' +_perlbrew_root_expanded=${(j::)~_perlbrew_root} + +if [[ -s "${_perlbrew_root}/etc/bashrc" ]]; then + export PERLBREW_ROOT="${_perlbrew_root}" + source "${_perlbrew_root}/etc/bashrc" + + unset _perlbrew_root + unset _perlbrew_root_expanded fi # # Local Module Installation # - -if [[ "$OSTYPE" == darwin* ]]; then +if [[ "$OSTYPE" == darwin* ]] && (( $+commands[perl] )); then # Perl is slow; cache its output. cache_file="${0:h}/cache.zsh" perl_path="$HOME/Library/Perl/5.12" @@ -29,13 +38,6 @@ if [[ "$OSTYPE" == darwin* ]]; then unset perl_path unset cache_file - - # Perlbrew - zstyle -s ':prezto:module:perl:perlbrew' location '_perlbrew_root' - if [[ -s "${_perlbrew_root}/etc/bashrc" ]]; then - export PERLBREW_ROOT="${_perlbrew_root}" - source "${_perlbrew_root}/etc/bashrc" - fi fi #