-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnode
executable file
·54 lines (45 loc) · 1.1 KB
/
node
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
# Remove this location from the PATH.
SELFNAME="${0##*/}"
OLD_IFS="$IFS"
OLD_PATH="$PATH"
IFS=":"
NEW_PATH=""
for path in $OLD_PATH; do
testpath="${path}/${SELFNAME}"
if ! [ -x "$testpath" ] || [ `diff $0 "$testpath"` ]; then
NEW_PATH="${NEW_PATH}:${path}"
fi
done
NEW_PATH="${NEW_PATH#:}"
IFS="$OLD_IFS"
PATH="$NEW_PATH"
# ! type nvm > /dev/null && [ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh # This loads NVM
[ -s $HOME/.nvm/nvm.sh ] && . $HOME/.nvm/nvm.sh # This loads NVM
# if type nvm > /dev/null && nvm which > /dev/null 2>&1; then
if type nvm > /dev/null 2>&1; then
nvm use > /dev/null 2>&1
#else
# echo "No node version specified by nvm. Using $NODE."
fi
exec "$SELFNAME" "$@"
#set -e
#[ -n "$RBENV_DEBUG" ] && set -x
#
#program="${0##*/}"
#if [ "$program" = "ruby" ]; then
# for arg; do
# case "$arg" in
# -e* | -- ) break ;;
# */* )
# if [ -f "$arg" ]; then
# export RBENV_DIR="${arg%/*}"
# break
# fi
# ;;
# esac
# done
#fi
#
#export RBENV_ROOT="/home/steven/.rbenv"
#exec "/home/steven/.rbenv/libexec/rbenv" exec "$program" "$@"