Cleaned up minor cruft in the Perl plugin.

Use path helpers where appropriate.
Removed an unnecessary if statement.
This commit is contained in:
Sorin Ionescu 2011-12-28 16:13:08 -05:00
parent c8b8861418
commit a5783e1256

View File

@ -13,7 +13,7 @@ if [[ "$OSTYPE" == darwin* ]]; then
cache_file="${0:h}/cache.zsh" cache_file="${0:h}/cache.zsh"
perl_path="$HOME/Library/Perl/5.12" perl_path="$HOME/Library/Perl/5.12"
if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then if [[ -f "$perl_path/lib/perl5/local/lib.pm" ]]; then
export MANPATH="$perl_path/man:$MANPATH" manpath=("$perl_path/man" $manpath)
if [[ ! -f "$cache_file" ]]; then if [[ ! -f "$cache_file" ]]; then
perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file" perl -I$perl_path/lib/perl5 -Mlocal::lib=$perl_path >! "$cache_file"
source "$cache_file" source "$cache_file"
@ -23,10 +23,8 @@ if [[ "$OSTYPE" == darwin* ]]; then
fi fi
unset perl_path unset perl_path
unset cache_file unset cache_file
fi
# Set environment variables for launchd processes. # Set environment variables for launchd processes.
if [[ "$OSTYPE" == darwin* ]]; then
for env_var in PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT PERL5LIB; do for env_var in PERL_LOCAL_LIB_ROOT PERL_MB_OPT PERL_MM_OPT PERL5LIB; do
launchctl setenv "$env_var" "${(P)env_var}" &! launchctl setenv "$env_var" "${(P)env_var}" &!
done done