From ef385a1adeb123fae5fb8907ee04583217339af7 Mon Sep 17 00:00:00 2001 From: Nathan Waddell - Contractor Date: Fri, 6 May 2016 16:02:35 -0500 Subject: [PATCH 1/4] Initial plenv plugin creation --- plugins/available/plenv.plugin.bash | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 plugins/available/plenv.plugin.bash diff --git a/plugins/available/plenv.plugin.bash b/plugins/available/plenv.plugin.bash new file mode 100644 index 00000000..2950fc78 --- /dev/null +++ b/plugins/available/plenv.plugin.bash @@ -0,0 +1,23 @@ +# Installs plenv and perl-build if not installed + +cite about-plugin +about-plugin 'Perl plenv plugin' + +pathmunge "${HOME}/.plenv/bin" + +[[ `which plenv` ]] && eval "$(plenv init -)" + +# What an incredible smell you've discovered! + +# detect bash +[[ $BASH ]] && SHELL_NAME='bash' + +# detect csh/tcsh + +# detect zsh +[[ $ZSH_NAME ]] && SHELL_NAME='zsh' + +# detect fish + +# Load the auto-completion script if plenv is installed. +[[ -e ~/.plenv/completions/plenv.${SHELL_NAME} ]] && source ~/.plenv/completions/plenv.${SHELL_NAME} From 812ed40e10052fbbc75a5fb670cf87b900acbd63 Mon Sep 17 00:00:00 2001 From: ravenhall Date: Fri, 6 May 2016 19:12:10 -0500 Subject: [PATCH 2/4] reworked plugin, user should install plenv separately --- plugins/available/plenv.plugin.bash | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/plugins/available/plenv.plugin.bash b/plugins/available/plenv.plugin.bash index 2950fc78..a3c21cfe 100644 --- a/plugins/available/plenv.plugin.bash +++ b/plugins/available/plenv.plugin.bash @@ -1,23 +1,17 @@ # Installs plenv and perl-build if not installed cite about-plugin -about-plugin 'Perl plenv plugin' +about-plugin 'plenv plugin for Perl' pathmunge "${HOME}/.plenv/bin" -[[ `which plenv` ]] && eval "$(plenv init -)" +if [[ `which plenv` ]] ; then -# What an incredible smell you've discovered! + # init plenv + eval "$(plenv init -)" -# detect bash -[[ $BASH ]] && SHELL_NAME='bash' + # Load the auto-completion script if it exists. + [[ -e ~/.plenv/completions/plenv.bash ]] && source ~/.plenv/completions/plenv.bash -# detect csh/tcsh - -# detect zsh -[[ $ZSH_NAME ]] && SHELL_NAME='zsh' - -# detect fish - -# Load the auto-completion script if plenv is installed. -[[ -e ~/.plenv/completions/plenv.${SHELL_NAME} ]] && source ~/.plenv/completions/plenv.${SHELL_NAME} +else echo "Unable to find plenv. See https://github.com/tokuhirom/plenv for installation" +fi From 1554a01e9c746f74d66e254d37a1709111d3f555 Mon Sep 17 00:00:00 2001 From: ravenhall Date: Fri, 6 May 2016 19:13:40 -0500 Subject: [PATCH 3/4] changed doc line for plugin --- plugins/available/plenv.plugin.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/available/plenv.plugin.bash b/plugins/available/plenv.plugin.bash index a3c21cfe..a9193fdb 100644 --- a/plugins/available/plenv.plugin.bash +++ b/plugins/available/plenv.plugin.bash @@ -1,4 +1,4 @@ -# Installs plenv and perl-build if not installed +# plugin for plenv cite about-plugin about-plugin 'plenv plugin for Perl' From 79321ce217f98991d8c37d881592d07746b6834c Mon Sep 17 00:00:00 2001 From: ravenhall Date: Mon, 9 May 2016 17:56:45 -0500 Subject: [PATCH 4/4] Only pathmunge if plenv path exists, removed error message when plenv not found --- plugins/available/plenv.plugin.bash | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/available/plenv.plugin.bash b/plugins/available/plenv.plugin.bash index a9193fdb..1cd8fa03 100644 --- a/plugins/available/plenv.plugin.bash +++ b/plugins/available/plenv.plugin.bash @@ -3,7 +3,12 @@ cite about-plugin about-plugin 'plenv plugin for Perl' -pathmunge "${HOME}/.plenv/bin" +if [[ -e "${HOME}/.plenv/bin" ]] ; then + + # load plenv bin dir into path if it exists + pathmunge "${HOME}/.plenv/bin" + +fi if [[ `which plenv` ]] ; then @@ -13,5 +18,4 @@ if [[ `which plenv` ]] ; then # Load the auto-completion script if it exists. [[ -e ~/.plenv/completions/plenv.bash ]] && source ~/.plenv/completions/plenv.bash -else echo "Unable to find plenv. See https://github.com/tokuhirom/plenv for installation" fi