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>2012-03-13 03:08:48 +0400
committerisaacs <i@izs.me>2012-03-13 03:08:48 +0400
commit2605310ed23ada71c93997c7d076718a628205f5 (patch)
tree03311bc5b7ac6f5b162f99c9513ed8f3f22d7774
parent541693c35ccea45dfdb7794a8f3cfe29193ef1c9 (diff)
Always favor the bundled node-gyp
-rwxr-xr-xbin/node-gyp-bin/node-gyp2
-rwxr-xr-xbin/node-gyp-bin/node-gyp.cmd1
-rw-r--r--lib/utils/lifecycle.js5
3 files changed, 8 insertions, 0 deletions
diff --git a/bin/node-gyp-bin/node-gyp b/bin/node-gyp-bin/node-gyp
new file mode 100755
index 000000000..345f07a18
--- /dev/null
+++ b/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" "$@"
diff --git a/bin/node-gyp-bin/node-gyp.cmd b/bin/node-gyp-bin/node-gyp.cmd
new file mode 100755
index 000000000..c2563ea11
--- /dev/null
+++ b/bin/node-gyp-bin/node-gyp.cmd
@@ -0,0 +1 @@
+node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %*
diff --git a/lib/utils/lifecycle.js b/lib/utils/lifecycle.js
index 085dcc88a..92b086e69 100644
--- a/lib/utils/lifecycle.js
+++ b/lib/utils/lifecycle.js
@@ -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" ? ";" : ":")