Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Aug 28, 2024
2 parents 3d30a3e + 2c8bd26 commit d8aa4ca
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [8, 16, 18, 20, latest]
node: [18, 20, 22, latest] # https://nodejs.org/en/about/previous-releases
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / Node ${{ matrix.node }}
steps:
Expand Down
5 changes: 5 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## Security contact information

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.
18 changes: 12 additions & 6 deletions bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ if (!buildFromSource()) {
}

function build () {
var args = [os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', 'rebuild']
var win32 = os.platform() === 'win32'
var shell = win32
var args = [win32 ? 'node-gyp.cmd' : 'node-gyp', 'rebuild']

try {
var pkg = require('node-gyp/package.json')
Expand All @@ -25,9 +27,10 @@ function build () {
path.join(require.resolve('node-gyp/package.json'), '..', typeof pkg.bin === 'string' ? pkg.bin : pkg.bin['node-gyp']),
'rebuild'
]
shell = false
} catch (_) {}

proc.spawn(args[0], args.slice(1), { stdio: 'inherit' }).on('exit', function (code) {
proc.spawn(args[0], args.slice(1), { stdio: 'inherit', shell, windowsHide: true }).on('exit', function (code) {
if (code || !process.argv[3]) process.exit(code)
exec(process.argv[3]).on('exit', function (code) {
process.exit(code)
Expand All @@ -45,15 +48,18 @@ function preinstall () {

function exec (cmd) {
if (process.platform !== 'win32') {
var shell = os.platform() === 'android' ? 'sh' : '/bin/sh'
return proc.spawn(shell, ['-c', '--', cmd], {
var shell = os.platform() === 'android' ? 'sh' : true
return proc.spawn(cmd, [], {
shell,
stdio: 'inherit'
})
}

return proc.spawn(process.env.comspec || 'cmd.exe', ['/s', '/c', '"' + cmd + '"'], {
return proc.spawn(cmd, [], {
windowsVerbatimArguments: true,
stdio: 'inherit'
stdio: 'inherit',
shell: true,
windowsHide: true
})
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-gyp-build",
"version": "4.8.0",
"version": "4.8.2",
"description": "Build tool and bindings loader for node-gyp that supports prebuilds",
"main": "index.js",
"devDependencies": {
Expand Down

0 comments on commit d8aa4ca

Please sign in to comment.