diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/clean-old.sh | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/scripts/clean-old.sh b/scripts/clean-old.sh index 668895630..63fa17646 100644 --- a/scripts/clean-old.sh +++ b/scripts/clean-old.sh @@ -3,27 +3,30 @@ # look for old 0.x cruft, and get rid of it. # Should already be sitting in the npm folder. -node="$NODE" -if [ "x$node" = "x" ]; then - node=`which node` -fi -if [ "x$node" = "x" ]; then - echo "Can't find node to determine prefix. Aborting." -fi +if ! [ "x$npm_config_preix" = "x" ]; then + PREFIXES=$npm_config_prefix +else + node="$NODE" + if [ "x$node" = "x" ]; then + node=`which node` + fi + if [ "x$node" = "x" ]; then + echo "Can't find node to determine prefix. Aborting." + fi -PREFIX=`dirname $node` -PREFIX=`dirname $PREFIX` -echo "prefix=$PREFIX" -PREFIXES=$PREFIX + PREFIX=`dirname $node` + PREFIX=`dirname $PREFIX` + echo "prefix=$PREFIX" + PREFIXES=$PREFIX -altprefix=`$node -e process.installPrefix` -if ! [ "x$altprefix" = "x" ] && ! [ "x$altprefix" = "x$PREFIX" ]; then - echo "altprefix=$altprefix" - PREFIXES="$PREFIX $altprefix" + altprefix=`$node -e process.installPrefix` + if ! [ "x$altprefix" = "x" ] && ! [ "x$altprefix" = "x$PREFIX" ]; then + echo "altprefix=$altprefix" + PREFIXES="$PREFIX $altprefix" + fi fi - # now prefix is where npm would be rooted by default # go hunting. |