Permalink
Browse files

Fix regression in PATH setting for lifecycle scripts

  • Loading branch information...
1 parent 2874df5 commit 0f9e34d037dec9925a86b7177e80b0dc7c7c0f2d @isaacs isaacs committed Mar 31, 2011
Showing with 6 additions and 6 deletions.
  1. +4 −4 lib/utils/lifecycle.js
  2. +2 −2 test/packages/npm-test-env-reader/test.sh
@@ -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(":")
@@ -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

0 comments on commit 0f9e34d

Please sign in to comment.