fix duplicate entries in PATH; especially after executing reload command
parent
60ce757151
commit
600d1c62de
|
|
@ -361,3 +361,12 @@ all_groups ()
|
|||
cat $file | sort | uniq
|
||||
rm $file
|
||||
}
|
||||
|
||||
function __append_uniq_path() {
|
||||
declare -r new_path="${PATH}:${1}";
|
||||
if [[ $(echo $new_path | tr ":" "\n" | sort | uniq -d) != *"${1}"* ]]; then
|
||||
export PATH="${PATH}:${1}";
|
||||
else
|
||||
return 1;
|
||||
fi
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
cite about-plugin
|
||||
about-plugin 'Node.js helper functions'
|
||||
|
||||
export PATH=./node_modules/.bin:$PATH
|
||||
__append_uniq_path './node_modules/.bin'
|
||||
|
||||
# Make sure the global npm prefix is on the path
|
||||
[[ `which npm` ]] && export PATH=$(npm config get prefix)/bin:$PATH
|
||||
|
||||
|
||||
[[ `which npm` ]] && __append_uniq_path "$(npm config get prefix)/bin"
|
||||
|
|
|
|||
Loading…
Reference in New Issue