mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 10:49:36 +02:00
New updates and modules
This commit is contained in:
parent
4d5d408898
commit
0abf0f90f6
959 changed files with 364301 additions and 17493 deletions
75
node_modules/node-gyp-build/bin.js
generated
vendored
Normal file
75
node_modules/node-gyp-build/bin.js
generated
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
var proc = require('child_process')
|
||||
var os = require('os')
|
||||
var path = require('path')
|
||||
|
||||
if (!buildFromSource()) {
|
||||
proc.exec('node-gyp-build-test', function (err, stdout, stderr) {
|
||||
if (err) {
|
||||
if (verbose()) console.error(stderr)
|
||||
preinstall()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
preinstall()
|
||||
}
|
||||
|
||||
function build () {
|
||||
var args = [os.platform() === 'win32' ? 'node-gyp.cmd' : 'node-gyp', 'rebuild']
|
||||
|
||||
try {
|
||||
args = [
|
||||
process.execPath,
|
||||
path.join(require.resolve('node-gyp/package.json'), '..', require('node-gyp/package.json').bin['node-gyp']),
|
||||
'rebuild'
|
||||
]
|
||||
} catch (_) {}
|
||||
|
||||
proc.spawn(args[0], args.slice(1), { stdio: 'inherit' }).on('exit', function (code) {
|
||||
if (code || !process.argv[3]) process.exit(code)
|
||||
exec(process.argv[3]).on('exit', function (code) {
|
||||
process.exit(code)
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function preinstall () {
|
||||
if (!process.argv[2]) return build()
|
||||
exec(process.argv[2]).on('exit', function (code) {
|
||||
if (code) process.exit(code)
|
||||
build()
|
||||
})
|
||||
}
|
||||
|
||||
function exec (cmd) {
|
||||
if (process.platform !== 'win32') {
|
||||
var shell = os.platform() === 'android' ? 'sh' : '/bin/sh'
|
||||
return proc.spawn(shell, ['-c', '--', cmd], {
|
||||
stdio: 'inherit'
|
||||
})
|
||||
}
|
||||
|
||||
return proc.spawn(process.env.comspec || 'cmd.exe', ['/s', '/c', '"' + cmd + '"'], {
|
||||
windowsVerbatimArguments: true,
|
||||
stdio: 'inherit'
|
||||
})
|
||||
}
|
||||
|
||||
function buildFromSource () {
|
||||
return hasFlag('--build-from-source')
|
||||
}
|
||||
|
||||
function verbose () {
|
||||
return hasFlag('--verbose')
|
||||
}
|
||||
|
||||
function hasFlag (flag) {
|
||||
if (!process.env.npm_config_argv) return false
|
||||
|
||||
try {
|
||||
return JSON.parse(process.env.npm_config_argv).original.indexOf(flag) !== -1
|
||||
} catch (_) {
|
||||
return false
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue