Permalink
Browse files

Always favor the bundled node-gyp

  • Loading branch information...
1 parent 541693c commit 2605310ed23ada71c93997c7d076718a628205f5 @isaacs isaacs committed Mar 12, 2012
Showing with 8 additions and 0 deletions.
  1. +2 −0 bin/node-gyp-bin/node-gyp
  2. +1 −0 bin/node-gyp-bin/node-gyp.cmd
  3. +5 −0 lib/utils/lifecycle.js
@@ -0,0 +1,2 @@
+#!/usr/bin/env sh
+node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@"
@@ -0,0 +1 @@
+node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %*
View
@@ -73,6 +73,11 @@ function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) {
acc = path.join(acc, "node_modules", pp)
})
pathArr.unshift(path.join(acc, "node_modules", ".bin"))
+
+ // we also unshift the bundled node-gyp-bin folder so that
+ // the bundled one will be used for installing things.
+ pathArr.unshift(path.join(__dirname, "..", "..", "bin", "node-gyp-bin"))
+
if (env[PATH]) pathArr.push(env[PATH])
env[PATH] = pathArr.join(process.platform === "win32" ? ";" : ":")

0 comments on commit 2605310

Please sign in to comment.