Skip to content

Commit c68a114

Browse files
committed
fix: remove the rest of process.argv executions
1 parent 4e6f605 commit c68a114

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

bin.js

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,9 @@ function build () {
2626
]
2727
} catch (_) {}
2828

29+
// run node-gyp-build
2930
proc.spawn(args[0], args.slice(1), { stdio: 'inherit' }).on('exit', function (code) {
30-
if (code || !process.argv[3]) process.exit(code)
31-
exec(process.argv[3]).on('exit', function (code) {
32-
process.exit(code)
33-
})
31+
if (code) process.exit(code)
3432
})
3533
}
3634

@@ -46,20 +44,6 @@ function preinstall () {
4644
}
4745
}
4846

49-
function exec (cmd) {
50-
if (process.platform !== 'win32') {
51-
var shell = os.platform() === 'android' ? 'sh' : '/bin/sh'
52-
return proc.spawn(shell, ['-c', '--', cmd], {
53-
stdio: 'inherit'
54-
})
55-
}
56-
57-
return proc.spawn(process.env.comspec || 'cmd.exe', ['/s', '/c', '"' + cmd + '"'], {
58-
windowsVerbatimArguments: true,
59-
stdio: 'inherit'
60-
})
61-
}
62-
6347
function buildFromSource () {
6448
return hasFlag('--build-from-source') || process.env.npm_config_build_from_source === 'true'
6549
}

0 commit comments

Comments
 (0)