// support --path to support failure testing clean(args.path || '.', function (err) { if (err) throw err })
function determineEnv() { if (process.env.EMBER_ENV) { return process.env.EMBER_ENV; } let args = parseArgs(process.argv); let env = args.e || args.env || args.environment; // Is it "ember b -prod" or "ember build --prod" command? if ( !env && (process.argv.indexOf('-prod') > -1 || process.argv.indexOf('--prod') > -1) ) { env = 'production'; } // Is it "ember test" or "ember t" command without explicit env specified? if ( !env && (process.argv.indexOf('test') > -1 || process.argv.indexOf('t') > -1) ) { env = 'test'; } return env || 'development'; }
commist() .register('user', function (argv) { const args = minimist(argv, { alias: { help: 'h' if (args.h) { printHelp('clinic-user') process.exit(0) if (args.server) { authenticate.getSession(args.server).then((user) => { if (!user) throw new Error('Expired') printUser(user) const args = minimist(argv, { alias: { help: 'h' if (args.h) { printHelp('clinic-login') process.exit(0) authenticate(args.server).then((authToken) => { const header = jwt.decode(authToken) if (header.name) { }) .register('logout', function (argv) { const args = minimist(argv, {
function torrentDone () { if (argv['on-done']) { cp.exec(argv['on-done']).unref() } if (!playerName && !serving && argv.out && !argv['keep-seeding']) { gracefulExit() } }
torrent.on('done', () => { if (!argv.quiet) { const numActiveWires = torrent.wires .reduce((num, wire) => num + (wire.downloaded > 0), 0) clivas.line('') clivas.line( 'torrent downloaded {green:successfully} from {bold:%s/%s} {green:peers} ' + 'in {bold:%ss}!', numActiveWires, torrent.numPeers, getRuntime() ) } torrentDone() })
conductor(options).compositions.deploy(composition, argv.overwrite) .then(actions => { const names = actions.map(action => action.name) console.log(`ok: created action${actions.length > 1 ? 's' : ''} ${names}`) }) .catch(error => { error.statusCode = error.statusCode || 500 console.error(error) process.exit(error.statusCode - 256) })
function runCheckName (name, online) { available.checkName(name, { online, related: argv.related }, printName) }
// THIS TEST IS CALLED DIRECTLY describe(`Testing static content generation ${argv.testgzip ? "" : "with cache"}`, () => { testCaching(); testPermalinkGeneration(); generationIndex(); after((done) => { done(); }); });
server.listen(argv.port, initServer) .on('error', err => { if (err.code === 'EADDRINUSE' || err.code === 'EACCES') { // If port is taken, pick one a free one automatically return server.listen(0, initServer) } return fatalError(err) })
function determineEnv() { if (process.env.EMBER_ENV) { return process.env.EMBER_ENV; } let args = parseArgs(process.argv); let env = args.e || args.env || args.environment; // Is it "ember b -prod" or "ember build --prod" command? if ( !env && (process.argv.indexOf('-prod') > -1 || process.argv.indexOf('--prod') > -1) ) { env = 'production'; } // Is it "ember test" or "ember t" command without explicit env specified? if ( !env && (process.argv.indexOf('test') > -1 || process.argv.indexOf('t') > -1) ) { env = 'test'; } return env || 'development'; }