deprecating _append_path and create _prepend_path

pull/2/head
Bruno Pinto 10 years ago
parent 73459aeb7d
commit b861a5cee1

@ -1,6 +1,10 @@
# Appends the path to the specified path list. If no list specified,
# defaults to $PATH
function _append_path
set_color red
echo '_append_path function deprecated. Rename to _prepend_path.'
set_color normal
set -l path PATH
if test (echo $argv | wc -w) -eq 2

@ -0,0 +1,14 @@
# Prepends the path to the specified path list. If no list specified, defaults to $PATH
function _prepend_path
set -l path PATH
if test (echo $argv | wc -w) -eq 2
set path $argv[2]
end
if test -d $argv[1]
if not contains $argv[1] $$path
set $path $argv[1] $$path
end
end
end

@ -6,16 +6,16 @@ function _fish_add_plugin
set -l plugin $argv[1]
set -l plugin_path "plugins/$plugin"
_append_path $fish_path/$plugin_path fish_function_path
_append_path $fish_custom/$plugin_path fish_function_path
_prepend_path $fish_path/$plugin_path fish_function_path
_prepend_path $fish_custom/$plugin_path fish_function_path
end
function _fish_add_completion
set -l plugin $argv[1]
set -l completion_path "plugins/$plugin/completions"
_append_path $fish_path/$completion_path fish_complete_path
_append_path $fish_custom/$completion_path fish_complete_path
_prepend_path $fish_path/$completion_path fish_complete_path
_prepend_path $fish_custom/$completion_path fish_complete_path
end
function _fish_source_plugin_load_file
@ -32,8 +32,8 @@ function _fish_source_plugin_load_file
end
function _fish_load_theme
_append_path $fish_path/themes/$fish_theme fish_function_path
_append_path $fish_custom/themes/$fish_theme fish_function_path
_prepend_path $fish_path/themes/$fish_theme fish_function_path
_prepend_path $fish_custom/themes/$fish_theme fish_function_path
end
###

@ -1,7 +1,7 @@
if test -n "$ANDROID_SDK_ROOT"
_append_path $ANDROID_SDK_ROOT/tools
_append_path $ANDROID_SDK_ROOT/platform-tools
_prepend_path $ANDROID_SDK_ROOT/tools
_prepend_path $ANDROID_SDK_ROOT/platform-tools
else
_append_path /opt/android-sdk/tools
_append_path /opt/android-sdk/platform-tools
_prepend_path /opt/android-sdk/tools
_prepend_path /opt/android-sdk/platform-tools
end

@ -3,7 +3,7 @@
set -gx USE_CCACHE 1
if test -n "$CCACHE_ROOT"
_append_path $CCACHE_ROOT
_prepend_path $CCACHE_ROOT
else
_append_path /usr/lib/ccache/bin
_prepend_path /usr/lib/ccache/bin
end

@ -1,4 +1,4 @@
if test -n "$GEM_ROOT"
set -gx GEM_HOME $GEM_ROOT
_append_path $GEM_ROOT/bin
_prepend_path $GEM_ROOT/bin
end

@ -1,3 +1,3 @@
for gvm_path in (find $HOME/.gvm/*/current/bin -maxdepth 0)
_append_path $gvm_path
end
_prepend_path $gvm_path
end

@ -1,7 +1,7 @@
if test -n "$NDENV_ROOT"
_append_path $NDENV_ROOT/bin
_append_path $NDENV_ROOT/shims
_prepend_path $NDENV_ROOT/bin
_prepend_path $NDENV_ROOT/shims
else
_append_path $HOME/.ndenv/bin
_append_path $HOME/.ndenv/shims
_prepend_path $HOME/.ndenv/bin
_prepend_path $HOME/.ndenv/shims
end

@ -1,4 +1,4 @@
### Main program
_append_path /usr/local/share/npm/bin
_prepend_path /usr/local/share/npm/bin
set PATH ./node_modules/.bin $PATH

@ -1,7 +1,7 @@
if test -n "$NODENV_ROOT"
_append_path $NODENV_ROOT/bin
_prepend_path $NODENV_ROOT/bin
else
_append_path $HOME/.nodenv/bin
_prepend_path $HOME/.nodenv/bin
end
status --is-interactive; and source (nodenv init - | psub)

@ -1,2 +1,2 @@
_append_path $HOME/.plenv/bin
_append_path $HOME/.plenv/shims
_prepend_path $HOME/.plenv/bin
_prepend_path $HOME/.plenv/shims

@ -1,7 +1,7 @@
if test -n "$PYENV_ROOT"
_append_path $PYENV_ROOT/bin
_append_path $PYENV_ROOT/shims
_prepend_path $PYENV_ROOT/bin
_prepend_path $PYENV_ROOT/shims
else
_append_path $HOME/.pyenv/bin
_append_path $HOME/.pyenv/shims
_prepend_path $HOME/.pyenv/bin
_prepend_path $HOME/.pyenv/shims
end

@ -1,7 +1,7 @@
if test -n "$RBENV_ROOT"
_append_path $RBENV_ROOT/bin
_append_path $RBENV_ROOT/shims
_prepend_path $RBENV_ROOT/bin
_prepend_path $RBENV_ROOT/shims
else
_append_path $HOME/.rbenv/bin
_append_path $HOME/.rbenv/shims
_prepend_path $HOME/.rbenv/bin
_prepend_path $HOME/.rbenv/shims
end

Loading…
Cancel
Save