From e06ec920f7a5d784e674c4c4b4e6d1da3dc7391d Mon Sep 17 00:00:00 2001 From: Piotr Russ Date: Mon, 16 Nov 2020 00:10:28 +0100 Subject: api, login, auth --- node_modules/npm-run-all/bin/common/bootstrap.js | 51 ++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 node_modules/npm-run-all/bin/common/bootstrap.js (limited to 'node_modules/npm-run-all/bin/common/bootstrap.js') diff --git a/node_modules/npm-run-all/bin/common/bootstrap.js b/node_modules/npm-run-all/bin/common/bootstrap.js new file mode 100644 index 0000000..e73b093 --- /dev/null +++ b/node_modules/npm-run-all/bin/common/bootstrap.js @@ -0,0 +1,51 @@ +/** + * @author Toru Nagashima + * @copyright 2016 Toru Nagashima. All rights reserved. + * See LICENSE file in root directory for full license. + */ +"use strict" + +//------------------------------------------------------------------------------ +// Public Interface +//------------------------------------------------------------------------------ +/*eslint-disable no-process-exit */ + +module.exports = function bootstrap(name) { + const argv = process.argv.slice(2) + + switch (argv[0]) { + case undefined: + case "-h": + case "--help": + return require(`../${name}/help`)(process.stdout) + + case "-v": + case "--version": + return require("./version")(process.stdout) + + default: + // https://github.com/mysticatea/npm-run-all/issues/105 + // Avoid MaxListenersExceededWarnings. + process.stdout.setMaxListeners(0) + process.stderr.setMaxListeners(0) + process.stdin.setMaxListeners(0) + + // Main + return require(`../${name}/main`)( + argv, + process.stdout, + process.stderr + ).then( + () => { + // I'm not sure why, but maybe the process never exits + // on Git Bash (MINGW64) + process.exit(0) + }, + () => { + process.exit(1) + } + ) + } +} + +/*eslint-enable */ -- cgit v1.2.3