Skip to content

Commit

Permalink
fix windows spawn shell (#72)
Browse files Browse the repository at this point in the history
fixes #71
  • Loading branch information
cb1kenobi authored Aug 28, 2024
1 parent 464e388 commit a428be4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ if (!buildFromSource()) {

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

try {
Expand All @@ -26,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', shell: win32, windowsHide: true }).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 Down

0 comments on commit a428be4

Please sign in to comment.