From bf0c5a70a46d49f53ae1f9b2000f1716101e4525 Mon Sep 17 00:00:00 2001 From: Patrick Baker Date: Mon, 17 Feb 2014 15:21:43 -0500 Subject: [PATCH] Allow perlbrew environment to be loaded via zstyle --- modules/perl/README.md | 4 ++++ modules/perl/init.zsh | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/modules/perl/README.md b/modules/perl/README.md index eabdc5cb..b2defe4d 100644 --- a/modules/perl/README.md +++ b/modules/perl/README.md @@ -30,6 +30,10 @@ Perlbrew An alternative to the above is to use [Perlbrew][2], which allows for the management of multiple, isolated Perl installations in the home directory. +You can specify the perlbrew location so the environment is automatically loaded. + + zstyle ':prezto:module:perl:perlbrew' location '/path/to/perlbrew' + Aliases ------- diff --git a/modules/perl/init.zsh b/modules/perl/init.zsh index 0997a4b2..82095633 100644 --- a/modules/perl/init.zsh +++ b/modules/perl/init.zsh @@ -29,6 +29,13 @@ 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 #