Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Commit

Permalink
Always favor the bundled node-gyp
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Mar 12, 2012
1 parent 541693c commit 2605310
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bin/node-gyp-bin/node-gyp
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@"
1 change: 1 addition & 0 deletions bin/node-gyp-bin/node-gyp.cmd
@@ -0,0 +1 @@
node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %*
5 changes: 5 additions & 0 deletions lib/utils/lifecycle.js
Expand Up @@ -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" ? ";" : ":")

Expand Down

0 comments on commit 2605310

Please sign in to comment.