Update to NPM version
This commit is contained in:
71
ProjectSourceCode/node_modules/npm-run-all/bin/npm-run-all/help.js
generated
vendored
Normal file
71
ProjectSourceCode/node_modules/npm-run-all/bin/npm-run-all/help.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
/**
|
||||
* @author Toru Nagashima
|
||||
* @copyright 2015 Toru Nagashima. All rights reserved.
|
||||
* See LICENSE file in root directory for full license.
|
||||
*/
|
||||
"use strict"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Public Interface
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Print a help text.
|
||||
*
|
||||
* @param {stream.Writable} output - A writable stream to print.
|
||||
* @returns {Promise} Always a fulfilled promise.
|
||||
* @private
|
||||
*/
|
||||
module.exports = function printHelp(output) {
|
||||
output.write(`
|
||||
Usage:
|
||||
$ npm-run-all [--help | -h | --version | -v]
|
||||
$ npm-run-all [tasks] [OPTIONS]
|
||||
|
||||
Run given npm-scripts in parallel or sequential.
|
||||
|
||||
<tasks> : A list of npm-scripts' names and Glob-like patterns.
|
||||
|
||||
Options:
|
||||
--aggregate-output - - - Avoid interleaving output by delaying printing of
|
||||
each command's output until it has finished.
|
||||
-c, --continue-on-error - Set the flag to continue executing
|
||||
other/subsequent tasks even if a task threw an
|
||||
error. 'npm-run-all' itself will exit with
|
||||
non-zero code if one or more tasks threw error(s)
|
||||
--max-parallel <number> - Set the maximum number of parallelism. Default is
|
||||
unlimited.
|
||||
--npm-path <string> - - - Set the path to npm. Default is the value of
|
||||
environment variable npm_execpath.
|
||||
If the variable is not defined, then it's "npm".
|
||||
In this case, the "npm" command must be found in
|
||||
environment variable PATH.
|
||||
-l, --print-label - - - - Set the flag to print the task name as a prefix
|
||||
on each line of output. Tools in tasks may stop
|
||||
coloring their output if this option was given.
|
||||
-n, --print-name - - - - Set the flag to print the task name before
|
||||
running each task.
|
||||
-p, --parallel <tasks> - Run a group of tasks in parallel.
|
||||
e.g. 'npm-run-all -p foo bar' is similar to
|
||||
'npm run foo & npm run bar'.
|
||||
-r, --race - - - - - - - Set the flag to kill all tasks when a task
|
||||
finished with zero. This option is valid only
|
||||
with 'parallel' option.
|
||||
-s, --sequential <tasks> - Run a group of tasks sequentially.
|
||||
--serial <tasks> e.g. 'npm-run-all -s foo bar' is similar to
|
||||
'npm run foo && npm run bar'.
|
||||
'--serial' is a synonym of '--sequential'.
|
||||
--silent - - - - - - - - Set 'silent' to the log level of npm.
|
||||
|
||||
Examples:
|
||||
$ npm-run-all --serial clean lint build:**
|
||||
$ npm-run-all --parallel watch:**
|
||||
$ npm-run-all clean lint --parallel "build:** -- --watch"
|
||||
$ npm-run-all -l -p start-server start-browser start-electron
|
||||
|
||||
See Also:
|
||||
https://github.com/mysticatea/npm-run-all#readme
|
||||
`)
|
||||
|
||||
return Promise.resolve(null)
|
||||
}
|
||||
13
ProjectSourceCode/node_modules/npm-run-all/bin/npm-run-all/index.js
generated
vendored
Executable file
13
ProjectSourceCode/node_modules/npm-run-all/bin/npm-run-all/index.js
generated
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* @author Toru Nagashima
|
||||
* @copyright 2015 Toru Nagashima. All rights reserved.
|
||||
* See LICENSE file in root directory for full license.
|
||||
*/
|
||||
"use strict"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Main
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
require("../common/bootstrap")("npm-run-all")
|
||||
77
ProjectSourceCode/node_modules/npm-run-all/bin/npm-run-all/main.js
generated
vendored
Normal file
77
ProjectSourceCode/node_modules/npm-run-all/bin/npm-run-all/main.js
generated
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* @author Toru Nagashima
|
||||
* @copyright 2015 Toru Nagashima. All rights reserved.
|
||||
* See LICENSE file in root directory for full license.
|
||||
*/
|
||||
"use strict"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Requirements
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
const runAll = require("../../lib")
|
||||
const parseCLIArgs = require("../common/parse-cli-args")
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Public Interface
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Parses arguments, then run specified npm-scripts.
|
||||
*
|
||||
* @param {string[]} args - Arguments to parse.
|
||||
* @param {stream.Writable} stdout - A writable stream to print logs.
|
||||
* @param {stream.Writable} stderr - A writable stream to print errors.
|
||||
* @returns {Promise} A promise which comes to be fulfilled when all npm-scripts are completed.
|
||||
* @private
|
||||
*/
|
||||
module.exports = function npmRunAll(args, stdout, stderr) {
|
||||
try {
|
||||
const stdin = process.stdin
|
||||
const argv = parseCLIArgs(args)
|
||||
|
||||
const promise = argv.groups.reduce(
|
||||
(prev, group) => {
|
||||
if (group.patterns.length === 0) {
|
||||
return prev
|
||||
}
|
||||
return prev.then(() => runAll(
|
||||
group.patterns,
|
||||
{
|
||||
stdout,
|
||||
stderr,
|
||||
stdin,
|
||||
parallel: group.parallel,
|
||||
maxParallel: group.parallel ? argv.maxParallel : 1,
|
||||
continueOnError: argv.continueOnError,
|
||||
printLabel: argv.printLabel,
|
||||
printName: argv.printName,
|
||||
config: argv.config,
|
||||
packageConfig: argv.packageConfig,
|
||||
silent: argv.silent,
|
||||
arguments: argv.rest,
|
||||
race: group.parallel && argv.race,
|
||||
npmPath: argv.npmPath,
|
||||
aggregateOutput: group.parallel && argv.aggregateOutput,
|
||||
}
|
||||
))
|
||||
},
|
||||
Promise.resolve(null)
|
||||
)
|
||||
|
||||
if (!argv.silent) {
|
||||
promise.catch(err => {
|
||||
//eslint-disable-next-line no-console
|
||||
console.error("ERROR:", err.message)
|
||||
})
|
||||
}
|
||||
|
||||
return promise
|
||||
}
|
||||
catch (err) {
|
||||
//eslint-disable-next-line no-console
|
||||
console.error("ERROR:", err.message)
|
||||
|
||||
return Promise.reject(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user