From 18a33690fe48722f31c1392b0741052d6ea23002 Mon Sep 17 00:00:00 2001 From: Bruno Pinto Date: Wed, 20 Nov 2013 07:53:57 -0200 Subject: [PATCH] using _append_path function on plugins --- plugins/node/node.load | 4 +--- plugins/plenv/plenv.load | 9 ++------- plugins/pyenv/pyenv.load | 16 ++++------------ plugins/python/python.load | 4 +--- plugins/rbenv/rbenv.load | 18 ++++-------------- 5 files changed, 12 insertions(+), 39 deletions(-) diff --git a/plugins/node/node.load b/plugins/node/node.load index 32af336..a72dec8 100644 --- a/plugins/node/node.load +++ b/plugins/node/node.load @@ -1,6 +1,4 @@ ### Main program -if test -d /usr/local/share/npm/bin - set PATH /usr/local/share/npm/bin $PATH -end +_append_path /usr/local/share/npm/bin set PATH ./node_modules/.bin $PATH diff --git a/plugins/plenv/plenv.load b/plugins/plenv/plenv.load index d4c60c7..107b6bf 100644 --- a/plugins/plenv/plenv.load +++ b/plugins/plenv/plenv.load @@ -1,7 +1,2 @@ -if test -d $HOME/.plenv/bin - set PATH $HOME/.plenv/bin $PATH -end - -if test -d $HOME/.plenv/shims - set PATH $HOME/.plenv/shims $PATH -end +_append_path $HOME/.plenv/bin +_append_path $HOME/.plenv/shims diff --git a/plugins/pyenv/pyenv.load b/plugins/pyenv/pyenv.load index 00176fa..5d771f6 100644 --- a/plugins/pyenv/pyenv.load +++ b/plugins/pyenv/pyenv.load @@ -1,15 +1,7 @@ if test -n "$PYENV_ROOT" - if test -d $PYENV_ROOT/bin - set PATH $PYENV_ROOT/bin $PATH - end - if test -d $PYENV_ROOT/shims - set PATH $PYENV_ROOT/shims $PATH - end + _append_path $PYENV_ROOT/bin + _append_path $PYENV_ROOT/shims else - if test -d $HOME/.pyenv/bin - set PATH $HOME/.pyenv/bin $PATH - end - if test -d $HOME/.pyenv/shims - set PATH $HOME/.pyenv/shims $PATH - end + _append_path $HOME/.pyenv/bin + _append_path $HOME/.pyenv/shims end diff --git a/plugins/python/python.load b/plugins/python/python.load index 7f2bbc2..d0eb8fe 100644 --- a/plugins/python/python.load +++ b/plugins/python/python.load @@ -1,4 +1,2 @@ -if test -d /usr/local/share/python - set PATH /usr/local/share/python $PATH -end +_append_path /usr/local/share/python diff --git a/plugins/rbenv/rbenv.load b/plugins/rbenv/rbenv.load index de49047..7becc30 100644 --- a/plugins/rbenv/rbenv.load +++ b/plugins/rbenv/rbenv.load @@ -1,17 +1,7 @@ if test -n "$RBENV_ROOT" - if test -d $RBENV_ROOT/bin - set PATH $RBENV_ROOT/bin $PATH - end - - if test -d $RBENV_ROOT/shims - set PATH $RBENV_ROOT/shims $PATH - end + _append_path $RBENV_ROOT/bin + _append_path $RBENV_ROOT/shims else - if test -d $HOME/.rbenv/bin - set PATH $HOME/.rbenv/bin $PATH - end - - if test -d $HOME/.rbenv/shims - set PATH $HOME/.rbenv/shims $PATH - end + _append_path $HOME/.rbenv/bin + _append_path $HOME/.rbenv/shims end