_isComponentPath(options, function (err) { if (!err) { // This is a component path! _solo(verbose, silent, options, callback); } else { // This is not a component path... // Can we do a full build instead? utilities.getWF2srcPath({ cwd: (options && options.cwd) ? options.cwd : cwd }, function (err, srcPath) { if (err) { // nothing we can do there... log.error('The current path cannot be built. Is it a wria2 path?'); callback(-1); } else { _full({ type: options.type, verbose: verbose, silent: silent, srcPath: srcPath, prompt: _.isBoolean(promptOption) ? promptOption : true, combo: options.combo }, callback); } }); } });
exports.startServer = function (verbose, silent, options, done) { utilities.getWF2srcPath({ cwd: (options && options.cwd) ? options.cwd : cwd }, function (err, wf2srcPath) { if (err) { // nothing we can do there... log.error('The current path cannot be served. Is it a wria2 path?'); log.echo(); done(-1); } else { var name = servers[options.server].name, command = servers[options.server].command, args = servers[options.server].args, url = servers[options.server].url, _afterServerStarted; _afterServerStarted = function (url) { log.success('Local server is up. Type CTRL+C to stop it.'); log.blue('URL is now available here:'); log.echo(url); log.echo(); utilities.openInBrowser({ confirm: true, url: url, message: 'Open it in your default browser?' }); }; if (options && options.args) { args = options.args; } cmd.run(command + ' ' + args, { pwd: wf2srcPath, foreground: true, trigger: { regex: (options.server === SERVER_TYPE_SELLECK) ? new RegExp(/Ferrari rides/) : new RegExp( /Starting server/), callback: function () { _afterServerStarted(url); } }, verbose: true, name: name }, done); } }); };
function (callback) { utilities.getWF2srcPath({ cwd: options.srcPath }, callback); },