Merge pull request #499 from ipoval/master
[pathmunge] remove duplicate entry into PATH variable on reload commandpull/504/merge
commit
cfef7e2f73
|
|
@ -365,10 +365,10 @@ all_groups ()
|
||||||
if ! type pathmunge > /dev/null 2>&1
|
if ! type pathmunge > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
function pathmunge () {
|
function pathmunge () {
|
||||||
_about 'prevent duplicate directories in you PATH variable'
|
about 'prevent duplicate directories in you PATH variable'
|
||||||
_group 'lib helpers'
|
group 'lib helpers'
|
||||||
_example 'pathmunge /path/to/dir is equivalent to PATH=/path/to/dir:$PATH'
|
example 'pathmunge /path/to/dir is equivalent to PATH=/path/to/dir:$PATH'
|
||||||
_example 'pathmunge /path/to/dir after is equivalent to PATH=$PATH:/path/to/dir'
|
example 'pathmunge /path/to/dir after is equivalent to PATH=$PATH:/path/to/dir'
|
||||||
|
|
||||||
if ! [[ $PATH =~ (^|:)$1($|:) ]] ; then
|
if ! [[ $PATH =~ (^|:)$1($|:) ]] ; then
|
||||||
if [ "$2" = "after" ] ; then
|
if [ "$2" = "after" ] ; then
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,6 @@ about-plugin 'use mactex'
|
||||||
# add mactex to the path if its present
|
# add mactex to the path if its present
|
||||||
MACTEX_PATH=/usr/local/texlive/2009/bin/universal-darwin
|
MACTEX_PATH=/usr/local/texlive/2009/bin/universal-darwin
|
||||||
if [[ -d $MACTEX_PATH ]]; then
|
if [[ -d $MACTEX_PATH ]]; then
|
||||||
export PATH=$PATH:$MACTEX_PATH
|
pathmunge $MACTEX_PATH after
|
||||||
fi
|
fi
|
||||||
unset MACTEX_PATH
|
unset MACTEX_PATH
|
||||||
|
|
|
||||||
|
|
@ -3,5 +3,5 @@ about-plugin 'load pipsi, if you are using it'
|
||||||
|
|
||||||
if [[ -f "$HOME/.local/bin/pipsi" ]]
|
if [[ -f "$HOME/.local/bin/pipsi" ]]
|
||||||
then
|
then
|
||||||
export PATH=~/.local/bin:$PATH
|
pathmunge ~/.local/bin
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,8 @@ cite about-plugin
|
||||||
about-plugin 'load pyenv, if you are using it'
|
about-plugin 'load pyenv, if you are using it'
|
||||||
|
|
||||||
export PYENV_ROOT="$HOME/.pyenv"
|
export PYENV_ROOT="$HOME/.pyenv"
|
||||||
export PATH="$PYENV_ROOT/bin:$PATH"
|
pathmunge $PYENV_ROOT
|
||||||
|
|
||||||
[[ `which pyenv` ]] && eval "$(pyenv init -)"
|
[[ `which pyenv` ]] && eval "$(pyenv init -)"
|
||||||
|
|
||||||
#Load pyenv virtualenv if the virtualenv plugin is installed.
|
#Load pyenv virtualenv if the virtualenv plugin is installed.
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
cite about-plugin
|
cite about-plugin
|
||||||
about-plugin 'load rbenv, if you are using it'
|
about-plugin 'load rbenv, if you are using it'
|
||||||
|
|
||||||
export PATH="$HOME/.rbenv/bin:$PATH"
|
pathmunge "${HOME}/.rbenv/bin"
|
||||||
|
|
||||||
[[ `which rbenv` ]] && eval "$(rbenv init -)"
|
[[ `which rbenv` ]] && eval "$(rbenv init -)"
|
||||||
|
|
||||||
# Load the auto-completion script if rbenv was loaded.
|
# Load the auto-completion script if rbenv was loaded.
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ about-plugin 'ruby and rubygems specific functions and settings'
|
||||||
# Make commands installed with 'gem install --user-install' available
|
# Make commands installed with 'gem install --user-install' available
|
||||||
# ~/.gem/ruby/${RUBY_VERSION}/bin/
|
# ~/.gem/ruby/${RUBY_VERSION}/bin/
|
||||||
if which ruby >/dev/null && which gem >/dev/null; then
|
if which ruby >/dev/null && which gem >/dev/null; then
|
||||||
PATH="$PATH:$(ruby -e 'print Gem.user_dir')/bin";
|
pathmunge "$(ruby -e 'print Gem.user_dir')/bin" after
|
||||||
fi
|
fi
|
||||||
|
|
||||||
function remove_gem {
|
function remove_gem {
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ fi
|
||||||
# respect ENV var set in .bash_profile, default is 't'
|
# respect ENV var set in .bash_profile, default is 't'
|
||||||
alias $TODO='$TODO_SRC_DIR/todo.sh -d $TODO_SRC_DIR/todo.cfg'
|
alias $TODO='$TODO_SRC_DIR/todo.sh -d $TODO_SRC_DIR/todo.cfg'
|
||||||
|
|
||||||
export PATH=$PATH:$TODO_SRC_DIR
|
pathmunge $TODO_SRC_DIR after
|
||||||
|
|
||||||
source $TODO_SRC_DIR/todo_completion # bash completion for todo.sh
|
source $TODO_SRC_DIR/todo_completion # bash completion for todo.sh
|
||||||
complete -F _todo $TODO # enable completion for 't' alias
|
complete -F _todo $TODO # enable completion for 't' alias
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env bats
|
#!/usr/bin/env bats
|
||||||
|
|
||||||
load ../test_helper
|
load ../test_helper
|
||||||
|
load ../../lib/helpers
|
||||||
load ../../lib/composure
|
load ../../lib/composure
|
||||||
load ../../plugins/available/ruby.plugin
|
load ../../plugins/available/ruby.plugin
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue