1 | #!/usr/bin/env node
|
2 | 'use strict';
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | debugger;
|
5 | var process = require('suman-browser-polyfills/modules/process');
|
6 | var global = require('suman-browser-polyfills/modules/global');
|
7 | var callable = true;
|
8 | var logExit = function (code) {
|
9 | if (callable) {
|
10 | callable = false;
|
11 | console.log('\n');
|
12 | console.log(' => Suman cli exiting with code: ', code);
|
13 | console.log('\n');
|
14 | }
|
15 | };
|
16 | process.once('exit', function (code) {
|
17 | if (!global.__suman || !global.__suman.isActualExitHandlerRegistered) {
|
18 | logExit(code);
|
19 | }
|
20 | });
|
21 | if (require.main !== module && process.env.SUMAN_EXTRANEOUS_EXECUTABLE !== 'yes') {
|
22 | console.log('Warning: attempted to require Suman index.js but this cannot be.\n' +
|
23 | 'Set the SUMAN_EXTRANEOUS_EXECUTABLE env variable to "yes" to get around this.');
|
24 | process.exit(1);
|
25 | }
|
26 | else {
|
27 | delete process.env['SUMAN_EXTRANEOUS_EXECUTABLE'];
|
28 | }
|
29 | function handleExceptionsAndRejections() {
|
30 | if (_suman && _suman.sumanOpts && (_suman.sumanOpts.ignore_uncaught_exceptions || _suman.sumanOpts.ignore_unhandled_rejections)) {
|
31 | console.error('\n => uncaughtException occurred, but we are ignoring due to the ' +
|
32 | '"--ignore-uncaught-exceptions" / "--ignore-unhandled-rejections" flag(s) you passed.');
|
33 | }
|
34 | else {
|
35 | console.error('\n => Use "--ignore-uncaught-exceptions" / "--ignore-unhandled-rejections" ' +
|
36 | 'to force suman to continue despite the error.');
|
37 | process.exit(59);
|
38 | }
|
39 | }
|
40 | process.on('uncaughtException', function (err) {
|
41 | debugger;
|
42 | if (typeof err !== 'object') {
|
43 | console.error(new Error("err passed to uncaughtException was not an object => " + err).stack);
|
44 | err = new Error(typeof err === 'string' ? err : util.inspect(err));
|
45 | }
|
46 | if (String(err.stack || err).match(/Cannot find module/i) && _suman && _suman.sumanOpts && _suman.sumanOpts.transpile) {
|
47 | console.log(' => If transpiling, you may need to transpile your entire test directory to the destination directory using the ' +
|
48 | '--transpile and --all options together.');
|
49 | }
|
50 | setTimeout(function () {
|
51 | if (err && !err._alreadyHandledBySuman) {
|
52 | err._alreadyHandledBySuman = true;
|
53 | console.error('\n => Suman "uncaughtException" event occurred =>\n', chalk.magenta(err.stack), '\n\n');
|
54 | handleExceptionsAndRejections();
|
55 | }
|
56 | }, 500);
|
57 | });
|
58 | process.on('unhandledRejection', function (err, p) {
|
59 | debugger;
|
60 | if (typeof err !== 'object') {
|
61 | console.error(new Error("err passed to unhandledRejection was not an object => '" + err + "'").stack);
|
62 | err = new Error(typeof err === 'string' ? err : util.inspect(err));
|
63 | }
|
64 | setTimeout(function () {
|
65 | if (err && !err._alreadyHandledBySuman) {
|
66 | err._alreadyHandledBySuman = true;
|
67 | console.error('\n\n => Suman "unhandledRejection" event occurred =>\n', (err.stack || err), '\n\n');
|
68 | handleExceptionsAndRejections();
|
69 | }
|
70 | }, 500);
|
71 | });
|
72 | var path = require("path");
|
73 | var util = require("util");
|
74 | var assert = require("assert");
|
75 | var EE = require("events");
|
76 | var semver = require("semver");
|
77 | var dashdash = require('dashdash');
|
78 | var chalk = require("chalk");
|
79 | var su = require("suman-utils");
|
80 | var _ = require("lodash");
|
81 | var uniqBy = require('lodash.uniqby');
|
82 | var events = require('suman-events').events;
|
83 | var _suman = global.__suman = (global.__suman || {});
|
84 | require('./lib/helpers/add-suman-global-properties');
|
85 | require('./lib/patches/all');
|
86 | var load_reporters_1 = require("./lib/helpers/load-reporters");
|
87 | var suman_constants_1 = require("./config/suman-constants");
|
88 | var general_1 = require("./lib/helpers/general");
|
89 | if (su.weAreDebugging) {
|
90 | _suman.log.info(' => Suman is in debug mode (we are debugging).');
|
91 | _suman.log.info(' => Process PID => ', process.pid);
|
92 | }
|
93 | _suman.log.info(chalk.magenta(' => Suman started with the following command:'), chalk.bold(util.inspect(process.argv)));
|
94 | _suman.log.info(' => $NODE_PATH is as follows:', process.env['NODE_PATH']);
|
95 | _suman.log.info('Resolved path of Suman executable =>', '"' + __filename + '"');
|
96 | var nodeVersion = process.version;
|
97 | var oldestSupported = suman_constants_1.constants.OLDEST_SUPPORTED_NODE_VERSION;
|
98 | if (semver.lt(nodeVersion, oldestSupported)) {
|
99 | _suman.log.error(chalk.red('warning => Suman is not well-tested against Node versions prior to ' +
|
100 | oldestSupported + '; your Node version: ' + chalk.bold(nodeVersion)));
|
101 | throw 'Please upgrade to a Node.js version newer than v6.0.0. Suman recommends usage of NVM.';
|
102 | }
|
103 | _suman.log.info('Node.js version:', chalk.bold(nodeVersion));
|
104 | var sumanLibRoot = _suman.sumanLibRoot = String(__dirname);
|
105 | var pkgJSON = require('./package.json');
|
106 | var sumanVersion = process.env.SUMAN_GLOBAL_VERSION = pkgJSON.version;
|
107 | _suman.log.info(chalk.italic('Suman ' + chalk.bold('v' + sumanVersion) + ' running...'));
|
108 | _suman.log.info('[process.pid] => ', process.pid);
|
109 | _suman.startTime = Date.now();
|
110 | var cwd = process.cwd();
|
111 | var sumanExecutablePath = _suman.sumanExecutablePath = process.env.SUMAN_EXECUTABLE_PATH = __filename;
|
112 | var projectRoot = _suman.projectRoot = process.env.SUMAN_PROJECT_ROOT = su.findProjectRoot(cwd);
|
113 | var cwdAsRoot = process.argv.indexOf('--cwd-is-root') > -1;
|
114 | if (!projectRoot) {
|
115 | if (!cwdAsRoot) {
|
116 | console.log(' => Warning => A NPM/Node.js project root could not be found given your current working directory.');
|
117 | console.log(chalk.red.bold(' => cwd:', cwd, ' '));
|
118 | console.log('\n', chalk.red.bold('=> Please execute the suman command from within the root of your project. '), '\n');
|
119 | console.log('\n', chalk.blue.bold('=> (Perhaps you need to run "npm init" before running "suman --init", ' +
|
120 | 'which will create a package.json file for you at the root of your project.) ') + '\n');
|
121 | process.exit(1);
|
122 | }
|
123 | else {
|
124 | projectRoot = _suman.projectRoot = process.env.SUMAN_PROJECT_ROOT = cwd;
|
125 | }
|
126 | }
|
127 | var sumanOpts = _suman.sumanOpts = require('./lib/parse-cmd-line-opts/parse-opts');
|
128 | _suman.sumanArgs = sumanOpts._args;
|
129 | if (su.vgt(7)) {
|
130 | _suman.log.info('Project root:', projectRoot);
|
131 | }
|
132 | if (cwd !== projectRoot) {
|
133 | if (su.vgt(1)) {
|
134 | _suman.log.info('Note that your current working directory is not equal to the project root:');
|
135 | _suman.log.info('cwd:', chalk.magenta(cwd));
|
136 | _suman.log.info('Project root:', chalk.magenta(projectRoot));
|
137 | }
|
138 | }
|
139 | else {
|
140 | if (su.vgt(2)) {
|
141 | if (cwd === projectRoot) {
|
142 | _suman.log.info(chalk.gray('cwd:', cwd));
|
143 | }
|
144 | }
|
145 | if (cwd !== projectRoot) {
|
146 | _suman.log.info(chalk.magenta('cwd:', cwd));
|
147 | }
|
148 | }
|
149 | var viaSuman = _suman.viaSuman = true;
|
150 | var resultBroadcaster = _suman.resultBroadcaster = (_suman.resultBroadcaster || new EE());
|
151 | var sumanConfig, pth;
|
152 | var configPath = sumanOpts.config;
|
153 | var serverName = sumanOpts.server_name;
|
154 | var convert = sumanOpts.convert_from_mocha;
|
155 | var src = sumanOpts.src;
|
156 | var dest = sumanOpts.dest;
|
157 | var init = sumanOpts.init;
|
158 | var uninstall = sumanOpts.uninstall;
|
159 | var force = sumanOpts.force;
|
160 | var fforce = sumanOpts.fforce;
|
161 | var s = sumanOpts.server;
|
162 | var tailRunner = sumanOpts.tail_runner;
|
163 | var tailTest = sumanOpts.tail_test;
|
164 | var useBabel = sumanOpts.use_babel;
|
165 | var useServer = sumanOpts.use_server;
|
166 | var tail = sumanOpts.tail;
|
167 | var removeBabel = sumanOpts.remove_babel;
|
168 | var create = sumanOpts.create;
|
169 | var watch = sumanOpts.watch;
|
170 | var useIstanbul = sumanOpts.use_istanbul;
|
171 | var interactive = sumanOpts.interactive;
|
172 | var appendMatchAny = sumanOpts.append_match_any;
|
173 | var appendMatchAll = sumanOpts.append_match_all;
|
174 | var appendMatchNone = sumanOpts.append_match_none;
|
175 | var matchAny = sumanOpts.match_any;
|
176 | var matchAll = sumanOpts.match_all;
|
177 | var matchNone = sumanOpts.match_none;
|
178 | var repair = sumanOpts.repair;
|
179 | var uninstallBabel = sumanOpts.uninstall_babel;
|
180 | var groups = sumanOpts.groups;
|
181 | var useTAPOutput = sumanOpts.use_tap_output;
|
182 | var fullStackTraces = sumanOpts.full_stack_traces;
|
183 | var coverage = sumanOpts.coverage;
|
184 | var diagnostics = sumanOpts.diagnostics;
|
185 | var installGlobals = sumanOpts.install_globals;
|
186 | var postinstall = sumanOpts.postinstall;
|
187 | var tscMultiWatch = sumanOpts.tsc_multi_watch;
|
188 | var sumanShell = sumanOpts.suman_shell;
|
189 | var watchPer = sumanOpts.watch_per;
|
190 | var singleProcess = sumanOpts.single_process;
|
191 | var script = sumanOpts.script;
|
192 | var browser = sumanOpts.browser;
|
193 | if (singleProcess) {
|
194 | process.env.SUMAN_SINGLE_PROCESS = 'yes';
|
195 | }
|
196 | if (watch || watchPer) {
|
197 | if (String(process.env.SUMAN_WATCH_TEST_RUN).trim() === 'yes') {
|
198 | throw new Error('Suman watch process has launched a process which in turn will watch, this is not allowed.');
|
199 | }
|
200 | }
|
201 | if (sumanOpts.user_args) {
|
202 | _suman.log.info(chalk.magenta('raw user_args is'), sumanOpts.user_args);
|
203 | }
|
204 | var userArgs = sumanOpts.user_args = _.flatten([sumanOpts.user_args]).join(' ');
|
205 | if (coverage) {
|
206 | _suman.log.info(chalk.magenta.bold('Coverage reports will be written out due to presence of --coverage flag.'));
|
207 | }
|
208 | var babelRegister = sumanOpts.babel_register;
|
209 | var noBabelRegister = sumanOpts.no_babel_register;
|
210 | var originalTranspileOption = sumanOpts.transpile = Boolean(sumanOpts.transpile);
|
211 | var sumanInstalledLocally = null;
|
212 | var sumanInstalledAtAll = null;
|
213 | var sumanServerInstalled = null;
|
214 | if (sumanOpts.version) {
|
215 | console.log('\n');
|
216 | _suman.log.info('Node.js version:', nodeVersion);
|
217 | _suman.log.info('Suman version:', sumanVersion);
|
218 | _suman.log.info('...And we\'re done here.', '\n');
|
219 | process.exit(0);
|
220 | }
|
221 | function makeThrow(msg) {
|
222 | console.log('\n');
|
223 | console.error('\n');
|
224 | throw msg;
|
225 | }
|
226 | if (sumanOpts.transpile && sumanOpts.no_transpile) {
|
227 | makeThrow(' => Suman fatal problem => --transpile and --no-transpile options were both set,' +
|
228 | ' please choose one only.');
|
229 | }
|
230 | if (sumanOpts.append_match_all && sumanOpts.match_all) {
|
231 | makeThrow(' => Suman fatal problem => --match-all and --append-match-all options were both set,' +
|
232 | ' please choose one only.');
|
233 | }
|
234 | if (sumanOpts.append_match_any && sumanOpts.match_any) {
|
235 | makeThrow(' => Suman fatal problem => --match-any and --append-match-any options were both set,' +
|
236 | ' please choose one only.');
|
237 | }
|
238 | if (sumanOpts.append_match_none && sumanOpts.match_none) {
|
239 | makeThrow(' => Suman fatal problem => --match-none and --append-match-none options were both set,' +
|
240 | ' please choose one only.');
|
241 | }
|
242 | if (sumanOpts.watch && sumanOpts.stop_watching) {
|
243 | makeThrow('=> Suman fatal problem => --watch and --stop-watching options were both set, ' +
|
244 | 'please choose one only.');
|
245 | }
|
246 | if (sumanOpts.babel_register && sumanOpts.no_babel_register) {
|
247 | makeThrow('=> Suman fatal problem => --babel-register and --no-babel-register command line options were both set,' +
|
248 | ' please choose one only.');
|
249 | }
|
250 | try {
|
251 | pth = path.resolve(configPath || (cwd + '/' + 'suman.conf.js'));
|
252 | sumanConfig = _suman.sumanConfig = require(pth);
|
253 | if (sumanOpts.verbosity > 8) {
|
254 | _suman.log.info(' => Suman verbose message => Suman config used: ' + pth);
|
255 | }
|
256 | }
|
257 | catch (err) {
|
258 | _suman.log.error(err.stack);
|
259 | if (!/Cannot find module/i.test(err.stack)) {
|
260 | throw err;
|
261 | }
|
262 | if (!init) {
|
263 | _suman.log.warning(chalk.bgBlack.yellow('warning => Could not load your config file ' +
|
264 | 'in your current working directory or given by --cfg at the command line...'));
|
265 | _suman.log.warning(chalk.bgBlack.yellow(' => ...are you sure you issued the suman command in the right directory? ' +
|
266 | '...now looking for a config file at the root of your project...'));
|
267 | }
|
268 | try {
|
269 | pth = path.resolve(projectRoot + '/' + 'suman.conf.js');
|
270 | sumanConfig = _suman.sumanConfig = require(pth);
|
271 | if (sumanOpts.verbosity > 2) {
|
272 | console.log(chalk.cyan(' => Suman config used: ' + pth + '\n'));
|
273 | }
|
274 | }
|
275 | catch (err) {
|
276 | _suman.usingDefaultConfig = true;
|
277 | _suman.log.warning('warning => Using default configuration file, please create your suman.conf.js ' +
|
278 | 'file using "suman --init".');
|
279 | sumanConfig = _suman.sumanConfig = require('./lib/default-conf-files/suman.default.conf.js');
|
280 | }
|
281 | }
|
282 | if (init) {
|
283 | console.log(chalk.magenta(' => "suman --init" is running.'));
|
284 | sumanConfig = _suman.sumanConfig = _suman.sumanConfig || {};
|
285 | }
|
286 | else {
|
287 | var vetLocalInstallations = require('./lib/cli-helpers/determine-if-suman-is-installed').vetLocalInstallations;
|
288 | var installObj = vetLocalInstallations(sumanConfig, sumanOpts, projectRoot);
|
289 | sumanInstalledAtAll = installObj.sumanInstalledAtAll;
|
290 | sumanServerInstalled = installObj.sumanServerInstalled;
|
291 | sumanInstalledLocally = installObj.sumanInstalledLocally;
|
292 | }
|
293 | var sumanPaths = general_1.resolveSharedDirs(sumanConfig, projectRoot, sumanOpts);
|
294 | var sumanObj = general_1.loadSharedObjects(sumanPaths, projectRoot, sumanOpts);
|
295 | if (sumanOpts.parallel && sumanOpts.series) {
|
296 | throw chalk.red('suman usage error => "--series" and "--parallel" options were both used, ' +
|
297 | 'please choose one or neither...but not both!');
|
298 | }
|
299 | if ('concurrency' in sumanOpts) {
|
300 | assert(Number.isInteger(sumanOpts.concurrency) && Number(sumanOpts.concurrency) > 0, chalk.red(' => Suman usage error => "--concurrency" option value should be an integer greater than 0.'));
|
301 | }
|
302 | _suman.maxProcs = sumanOpts.concurrency || sumanConfig.maxParallelProcesses || 15;
|
303 | sumanOpts.$useTAPOutput = _suman.useTAPOutput = sumanConfig.useTAPOutput || useTAPOutput;
|
304 | sumanOpts.$useTAPOutput && _suman.log.info('using TAP output => ', sumanOpts.$useTAPOutput);
|
305 | sumanOpts.$fullStackTraces = sumanConfig.fullStackTraces || sumanOpts.full_stack_traces;
|
306 | var sumanMatchesAny = (matchAny || (sumanConfig.matchAny || []).concat(appendMatchAny || []))
|
307 | .map(function (item) { return (item instanceof RegExp) ? item : new RegExp(item); });
|
308 | if (sumanMatchesAny.length < 1) {
|
309 | _suman.log.warning('no runnable file regexes available; using the default => /\.js$/');
|
310 | sumanMatchesAny.push(/\.js$/);
|
311 | }
|
312 | var sumanMatchesNone = (matchNone || (sumanConfig.matchNone || []).concat(appendMatchNone || []))
|
313 | .map(function (item) { return (item instanceof RegExp) ? item : new RegExp(item); });
|
314 | var sumanMatchesAll = (matchAll || (sumanConfig.matchAll || []).concat(appendMatchAll || []))
|
315 | .map(function (item) { return (item instanceof RegExp) ? item : new RegExp(item); });
|
316 | _suman.sumanMatchesAny = uniqBy(sumanMatchesAny, function (item) { return item; });
|
317 | _suman.sumanMatchesNone = uniqBy(sumanMatchesNone, function (item) { return item; });
|
318 | _suman.sumanMatchesAll = uniqBy(sumanMatchesAll, function (item) { return item; });
|
319 | var preOptCheck = {
|
320 | tscMultiWatch: tscMultiWatch, watch: watch, watchPer: watchPer,
|
321 | create: create, useServer: useServer, useBabel: useBabel,
|
322 | useIstanbul: useIstanbul, init: init, uninstall: uninstall,
|
323 | convert: convert, groups: groups, s: s, interactive: interactive, uninstallBabel: uninstallBabel,
|
324 | diagnostics: diagnostics, installGlobals: installGlobals, postinstall: postinstall,
|
325 | repair: repair, sumanShell: sumanShell, script: script
|
326 | };
|
327 | var optCheck = Object.keys(preOptCheck).filter(function (key, index) {
|
328 | return preOptCheck[key];
|
329 | })
|
330 | .map(function (key) {
|
331 | var value = preOptCheck[key];
|
332 | var obj = {};
|
333 | obj[key] = value;
|
334 | return obj;
|
335 | });
|
336 | if (optCheck.length > 1) {
|
337 | console.error('\t => Too many options, pick one from:\n', util.inspect(Object.keys(preOptCheck)));
|
338 | console.error('\t => Current options used were:\n', util.inspect(optCheck));
|
339 | console.error('\t => Use --help for more information.\n');
|
340 | console.error('\t => Use --examples to see command line examples for using Suman in the intended manner.\n');
|
341 | process.exit(suman_constants_1.constants.EXIT_CODES.BAD_COMMAND_LINE_OPTION);
|
342 | }
|
343 | load_reporters_1.loadReporters(sumanOpts, projectRoot, sumanConfig);
|
344 | resultBroadcaster.emit(String(events.NODE_VERSION), nodeVersion);
|
345 | resultBroadcaster.emit(String(events.SUMAN_VERSION), sumanVersion);
|
346 | var paths = _.flatten([sumanOpts._args]).slice(0);
|
347 | if (sumanOpts.test_paths_json) {
|
348 | var jsonPaths = JSON.parse(String(sumanOpts.test_paths_json).trim());
|
349 | jsonPaths.forEach(function (p) {
|
350 | paths.push(p);
|
351 | });
|
352 | }
|
353 | if (sumanOpts.replace_match && sumanOpts.replace_with) {
|
354 | paths = paths.map(function (p) {
|
355 | return String(p).replace(sumanOpts.replace_match, sumanOpts.replace_with);
|
356 | });
|
357 | }
|
358 | if (sumanOpts.replace_ext_with) {
|
359 | paths = paths.map(function (p) {
|
360 | return String(p).substr(0, String(p).lastIndexOf('.')) + sumanOpts.replace_ext_with;
|
361 | });
|
362 | }
|
363 | if (su.vgt(7)) {
|
364 | console.log(' => Suman verbose message => arguments assumed to be test file paths to be run:', paths);
|
365 | if (paths.length < 1) {
|
366 | console.log(' => Suman verbose message => Since no paths were passed at the command line, we \n' +
|
367 | 'default to running tests from the "testSrc" directory (defined in your suman.conf.js file).');
|
368 | }
|
369 | }
|
370 | if (sumanOpts.force_inherit_stdio) {
|
371 | _suman.$forceInheritStdio = true;
|
372 | }
|
373 | var isTTY = process.stdout.isTTY;
|
374 | if (String(process.env.SUMAN_WATCH_TEST_RUN).trim() !== 'yes') {
|
375 | if (!process.stdout.isTTY && !useTAPOutput) {
|
376 | _suman.log.error(chalk.yellow.bold('you may need to turn on TAP output for test results to be captured in destination process.'));
|
377 | }
|
378 | }
|
379 | if (diagnostics) {
|
380 | require('./lib/cli-commands/run-diagnostics').run(sumanOpts);
|
381 | }
|
382 | else if (script) {
|
383 | require('./lib/cli-commands/run-scripts').run(sumanConfig, sumanOpts);
|
384 | }
|
385 | else if (tscMultiWatch) {
|
386 | require('./lib/cli-commands/run-tscmultiwatch').run(sumanOpts);
|
387 | }
|
388 | else if (repair) {
|
389 | require('./lib/cli-commands/run-repair').run(sumanOpts);
|
390 | }
|
391 | else if (postinstall) {
|
392 | require('./lib/cli-commands/postinstall').run(sumanOpts);
|
393 | }
|
394 | else if (installGlobals) {
|
395 | require('./lib/cli-commands/install-global-deps')(paths);
|
396 | }
|
397 | else if (sumanShell) {
|
398 | require('./lib/cli-commands/run-suman-shell').run(projectRoot, sumanLibRoot, sumanOpts.suman_d_opts);
|
399 | }
|
400 | else if (interactive) {
|
401 | require('./lib/cli-commands/run-suman-interactive').run();
|
402 | }
|
403 | else if (uninstallBabel) {
|
404 | require('./lib/use-babel/uninstall-babel')(null);
|
405 | }
|
406 | else if (useIstanbul) {
|
407 | require('./lib/use-istanbul/use-istanbul')();
|
408 | }
|
409 | else if (create) {
|
410 | require('./lib/cli-commands/create-opt').run(create);
|
411 | }
|
412 | else if (useServer) {
|
413 | require('./lib/use-server/use-server')(null);
|
414 | }
|
415 | else if (useBabel) {
|
416 | require('./lib/use-babel/use-babel')(null);
|
417 | }
|
418 | else if (init) {
|
419 | require('./lib/cli-commands/init-opt').run(sumanOpts, projectRoot, cwd);
|
420 | }
|
421 | else if (uninstall) {
|
422 | require('./lib/uninstall/uninstall-suman')({
|
423 | force: force,
|
424 | fforce: fforce,
|
425 | removeBabel: removeBabel,
|
426 | });
|
427 | }
|
428 | else if (convert) {
|
429 | require('./lib/cli-commands/convert-mocha').run(projectRoot, src, dest, force);
|
430 | }
|
431 | else if (s) {
|
432 | require('./lib/cli-commands/start-suman-server')(sumanServerInstalled, sumanConfig, serverName);
|
433 | }
|
434 | else if (!browser && (watch || watchPer)) {
|
435 | require('./lib/cli-commands/watching').run(projectRoot, paths, sumanOpts, sumanConfig);
|
436 | }
|
437 | else if (groups) {
|
438 | require('./lib/cli-commands/groups').run(paths);
|
439 | }
|
440 | else {
|
441 | if (userArgs.length > 0 && sumanOpts.verbosity > 4) {
|
442 | _suman.log.info('The following "--user-args" will be passed to child processes as process.argv:');
|
443 | _suman.log.info(userArgs);
|
444 | }
|
445 | require('./lib/run').run(sumanOpts, sumanConfig, paths, sumanServerInstalled, sumanVersion);
|
446 | }
|