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-03-31 05:14:31 +0400
committerisaacs <i@izs.me>2011-03-31 05:14:31 +0400
commit0f9e34d037dec9925a86b7177e80b0dc7c7c0f2d (patch)
treef90c814ac730e404c67a49fb10e5564c561fdcdb
parent2874df5dde8fa7d5bb0557b3ae27218fc995a572 (diff)
Fix regression in PATH setting for lifecycle scripts
-rw-r--r--lib/utils/lifecycle.js8
-rwxr-xr-xtest/packages/npm-test-env-reader/test.sh4
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/utils/lifecycle.js b/lib/utils/lifecycle.js
index 6b8504281..7245991c1 100644
--- a/lib/utils/lifecycle.js
+++ b/lib/utils/lifecycle.js
@@ -45,12 +45,12 @@ function checkForLink (pkg, cb) {
function lifecycle_ (pkg, stage, wd, env, cb) {
var PATH = []
, p = wd.split("node_modules")
- , acc = p.shift()
- p.pop()
+ , acc = path.resolve(p.shift())
p.forEach(function (pp) {
- PATH.push(path.resolve(acc, "node_modules", ".bin"))
- acc = path.resolve(acc, "node_modules", pp)
+ PATH.unshift(path.join(acc, "node_modules", ".bin"))
+ acc = path.join(acc, "node_modules", pp)
})
+ PATH.unshift(path.join(acc, "node_modules", ".bin"))
if (env.PATH) PATH.push(env.PATH)
env.PATH = PATH.join(":")
diff --git a/test/packages/npm-test-env-reader/test.sh b/test/packages/npm-test-env-reader/test.sh
index c31a53db1..b2384df0b 100755
--- a/test/packages/npm-test-env-reader/test.sh
+++ b/test/packages/npm-test-env-reader/test.sh
@@ -1,3 +1,3 @@
#!/usr/bin/env sh
-env | grep npm | sort | egrep 'dependency|bundle'
-echo NODE_PATH=$NODE_PATH
+env | grep npm
+echo PATH=$PATH