Commit 19700c18 authored by Bruno Pinto's avatar Bruno Pinto

Merge branch 'extracting_append_path_function'

parents 985c2387 18a33690
# Appends the path to the specified path list. If no list specified,
# defaults to $PATH
function _append_path
set -l path PATH
if test (echo $argv | wc -w) -eq 2
set path $argv[2]
end
if test -d $argv[1]; and not contains $argv[1] $$path
set $path $argv[1] $$path
end
end
......@@ -13,26 +13,16 @@ function _fish_add_plugin
set -l plugin $argv[1]
set -l plugin_path "plugins/$plugin"
if _test_dir $fish_path/$plugin_path $fish_function_path
set fish_function_path $fish_path/$plugin_path $fish_function_path
end
if _test_dir $fish_custom/$plugin_path $fish_function_path
set fish_function_path $fish_custom/$plugin_path $fish_function_path
end
_append_path $fish_path/$plugin_path fish_function_path
_append_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"
if test -d $fish_path/$completion_path
set fish_complete_path $fish_path/$completion_path $fish_complete_path
end
if test -d $fish_custom/$completion_path
set fish_complete_path $fish_custom/$completion_path $fish_complete_path
end
_append_path $fish_path/$completion_path fish_complete_path
_append_path $fish_custom/$completion_path fish_complete_path
end
function _fish_source_plugin_load_file
......@@ -49,13 +39,8 @@ function _fish_source_plugin_load_file
end
function _fish_load_theme
if _test_dir $fish_path/themes/$fish_theme $fish_function_path
set fish_function_path $fish_path/themes/$fish_theme $fish_function_path
end
if _test_dir $fish_custom/themes/$fish_theme $fish_function_path
set fish_function_path $fish_custom/themes/$fish_theme $fish_function_path
end
_append_path $fish_path/themes/$fish_theme fish_function_path
_append_path $fish_custom/themes/$fish_theme fish_function_path
end
###
......
......@@ -9,5 +9,4 @@ function djtest
else
time python manage.py test $VERBOSE
end
end
# gitignore.io cli for fish
#
function gi
#curl http://gitignore.io/api/$argv
......
### 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
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
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
if test -d /usr/local/share/python
set PATH /usr/local/share/python $PATH
end
_append_path /usr/local/share/python
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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment