summaryrefslogtreecommitdiffstats
path: root/node_modules/npm-run-all/bin/run-p/main.js
diff options
context:
space:
mode:
authorGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
committerGravatar Piotr Russ <mail@pruss.it> 2020-11-16 00:10:28 +0100
commite06ec920f7a5d784e674c4c4b4e6d1da3dc7391d (patch)
tree55713f725f77b44ebfec86e4eec3ce33e71458ca /node_modules/npm-run-all/bin/run-p/main.js
downloadwebsite_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.gz
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.tar.bz2
website_creator-e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d.zip
api, login, auth
Diffstat (limited to 'node_modules/npm-run-all/bin/run-p/main.js')
-rw-r--r--node_modules/npm-run-all/bin/run-p/main.js74
1 files changed, 74 insertions, 0 deletions
diff --git a/node_modules/npm-run-all/bin/run-p/main.js b/node_modules/npm-run-all/bin/run-p/main.js
new file mode 100644
index 0000000..e44f2f2
--- /dev/null
+++ b/node_modules/npm-run-all/bin/run-p/main.js
@@ -0,0 +1,74 @@
+/**
+ * @author Toru Nagashima
+ * @copyright 2016 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, { parallel: true }, { singleMode: true })
+ const group = argv.lastGroup
+
+ if (group.patterns.length === 0) {
+ return Promise.resolve(null)
+ }
+
+ const promise = runAll(
+ group.patterns,
+ {
+ stdout,
+ stderr,
+ stdin,
+ parallel: group.parallel,
+ maxParallel: argv.maxParallel,
+ continueOnError: argv.continueOnError,
+ printLabel: argv.printLabel,
+ printName: argv.printName,
+ config: argv.config,
+ packageConfig: argv.packageConfig,
+ silent: argv.silent,
+ arguments: argv.rest,
+ race: argv.race,
+ npmPath: argv.npmPath,
+ aggregateOutput: argv.aggregateOutput,
+ }
+ )
+
+ 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)
+ }
+}