diff --git a/bin/node-gyp-bin/node-gyp b/bin/node-gyp-bin/node-gyp new file mode 100755 index 0000000000000..70efb6f339f76 --- /dev/null +++ b/bin/node-gyp-bin/node-gyp @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +if [ "x$npm_config_node_gyp" = "x" ]; then + node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@" +else + "$npm_config_node_gyp" "$@" +fi diff --git a/bin/node-gyp-bin/node-gyp.cmd b/bin/node-gyp-bin/node-gyp.cmd new file mode 100755 index 0000000000000..1ef2ae0c68fc4 --- /dev/null +++ b/bin/node-gyp-bin/node-gyp.cmd @@ -0,0 +1,5 @@ +if not defined npm_config_node_gyp ( + node "%~dp0\..\..\node_modules\node-gyp\bin\node-gyp.js" %* +) else ( + node "%npm_config_node_gyp%" %* +) diff --git a/test/bin/windows-shims.js b/test/bin/windows-shims.js index 29c257fc7954d..8769f2a905458 100644 --- a/test/bin/windows-shims.js +++ b/test/bin/windows-shims.js @@ -1,7 +1,7 @@ const t = require('tap') const { spawnSync } = require('child_process') const { resolve, join, extname, basename, sep } = require('path') -const { readFileSync, chmodSync, readdirSync } = require('fs') +const { readFileSync, chmodSync, readdirSync, statSync } = require('fs') const Diff = require('diff') const { sync: which } = require('which') const { version } = require('../../package.json') @@ -10,8 +10,9 @@ const ROOT = resolve(__dirname, '../..') const BIN = join(ROOT, 'bin') const NODE = readFileSync(process.execPath) const SHIMS = readdirSync(BIN).reduce((acc, shim) => { - if (extname(shim) !== '.js') { - acc[shim] = readFileSync(join(BIN, shim), 'utf-8') + const p = join(BIN, shim) + if (extname(p) !== '.js' && !statSync(p).isDirectory()) { + acc[shim] = readFileSync(p, 'utf-8') } return acc }, {})