Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-05-03 23:00:52 +0400
committerisaacs <i@izs.me>2011-05-03 23:00:52 +0400
commitb599811a9225b72df322e2112e570aa8b8623c2a (patch)
treeeba7b2328b6b309fae5733c433b5d2017ac7926f /scripts
parent7d7ad6304cfe8eb9dfb99a5d852c1c95edf3fadd (diff)
If there's a prefix env, use that rather than sniffing
Diffstat (limited to 'scripts')
-rw-r--r--scripts/clean-old.sh35
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.