From 9988f4033dd0af225e65b631e585032c57e15e11 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 18 Jun 2017 16:24:18 +1200 Subject: Break plenv stuff into its own target --- plenv/profile.d/plenv.sh | 5 +++++ plenv/shrc.d/plenv.sh | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 plenv/profile.d/plenv.sh create mode 100644 plenv/shrc.d/plenv.sh (limited to 'plenv') diff --git a/plenv/profile.d/plenv.sh b/plenv/profile.d/plenv.sh new file mode 100644 index 00000000..b2b491e1 --- /dev/null +++ b/plenv/profile.d/plenv.sh @@ -0,0 +1,5 @@ +# Add plenv to PATH and MANPATH if it appears to be in use +[ -d "$HOME"/.plenv ] || return +PATH=$HOME/.plenv/shims:$HOME/.plenv/bin:$PATH +MANPATH=$HOME/.plenv/versions/$(perl -e 'print substr($^V,1)')/man:$MANPATH +export MANPATH diff --git a/plenv/shrc.d/plenv.sh b/plenv/shrc.d/plenv.sh new file mode 100644 index 00000000..6e03618e --- /dev/null +++ b/plenv/shrc.d/plenv.sh @@ -0,0 +1,17 @@ +# POSIX-compatible version of the plenv Bash shell wrapper +[ -d "$HOME"/.plenv ] || return +plenv() { + case $1 in + rehash) + shift + eval "$(plenv sh-rehash "$@")" + ;; + shell) + shift + eval "$(plenv sh-shell "$@")" + ;; + *) + command plenv "$@" + ;; + esac +} -- cgit v1.2.3