diff options
author | isaacs <i@izs.me> | 2011-03-31 05:14:31 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-03-31 05:14:31 +0400 |
commit | 0f9e34d037dec9925a86b7177e80b0dc7c7c0f2d (patch) | |
tree | f90c814ac730e404c67a49fb10e5564c561fdcdb | |
parent | 2874df5dde8fa7d5bb0557b3ae27218fc995a572 (diff) |
Fix regression in PATH setting for lifecycle scripts
-rw-r--r-- | lib/utils/lifecycle.js | 8 | ||||
-rwxr-xr-x | test/packages/npm-test-env-reader/test.sh | 4 |
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 |