1
0
mirror of https://github.com/robbyrussell/oh-my-zsh.git synced 2025-12-06 07:20:40 +01:00

feat(perl): add perlbrew auto activation (#12814)

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
jamesrtnz
2025-01-24 08:24:43 +13:00
committed by GitHub
parent 501f29f90c
commit 9a0e22c184
2 changed files with 32 additions and 17 deletions

View File

@@ -54,3 +54,12 @@ pgs() { # [find] [replace] [filename]
prep() { # [pattern] [filename unless STDOUT]
perl -nle 'print if /'"$1"'/;' $2
}
# If the 'perlbrew' function isn't defined, perlbrew isn't setup.
if [[ $ZSH_PERLBREW_ACTIVATE != false ]] && (( ! $+functions[perlbrew] )); then
local _perlbrew="${PERLBREW_ROOT:-${HOME}/perl5/perlbrew}"
if [[ -f "${_perlbrew}/etc/bashrc" ]]; then
source "${_perlbrew}/etc/bashrc"
fi
unset _perlbrew
fi