exec('npm run lint', (err, stdout) => { ui.writeLine(stdout); if (err) { ui.writeLine(chalk.red('Lint errors found in the listed files.')); } else { ui.writeLine(chalk.green('All files pass linting.')); } resolve(); });
return replace(this.config).then(changedFiles => { if (changedFiles.length > 0) { console.log(); console.log(chalk.green(changedFiles.length, 'file(s) were changed')); changedFiles.forEach(file => console.log(chalk.grey('-', file))); } else { console.log(chalk.yellow('No files were changed')); } });
(err: NodeJS.ErrnoException, _stdout: string, stderr: string) => { if (err) { ui.writeLine(stderr); ui.writeLine(chalk.red('Package install failed, see above.')); reject(); } else { ui.writeLine(chalk.green(`Installed packages for tooling via ${packageManager}.`)); resolve(); } });
.then((token: string) => { // get the aad token aadToken = token; console.log(chalk.green('.. obtained AAD access token.')); // use aad token to request parter center token console.log(chalk.white('Obtaining Partner Center token..')); let pcAuth: PartnerCenterAuth = new PartnerCenterAuth(); return pcAuth.login(aadToken); })
.on('close', (code: number) => { if (code === 0) { ui.writeLine(chalk.green(`Installed packages for tooling via ${packageManager}.`)); resolve(); } else { const message = 'Package install failed, see above.'; ui.writeLine(chalk.red(message)); reject(message); } });
export async function setupCommand() { await createConfiguration() console.log( chalk.green( `Created configuration file ${chalk.cyan( 'text-run.yml' )} with default values` ) ) }
exec(`npm run e2e -- ${this.project.ngConfig.e2e.protractor.config}`, (err, stdout, stderr) => { ui.writeLine(stdout); if (err) { ui.writeLine(stderr); ui.writeLine(chalk.red('Some end-to-end tests failed, see above.')); } else { ui.writeLine(chalk.green('All end-to-end tests pass.')); } resolve(); });
.then((story: IStory) => { const id = story.id; const storySlug = slug(story.name).toLowerCase(); const gitCmd = `git checkout -b ${story.story_type}/ch${id}/${storySlug}`; console.info(Chalk.green(`Successfully created a story with id ${id}`)); console.info("You can view your story at " + link(`https://app.clubhouse.io/story/${id}`)); console.info("To start working on this story (copied to clipboard): " + Chalk.bold(gitCmd)); writeSync(gitCmd); return story; })
stop(msg: string = chalk.green(figures.tick) as any) { const task = this.task if (!task) { return } this.status = msg this._stop() task.active = false delete this.task }
mongoose.connect(nconf.get("db"), (err) => { if (err) { console.error(chalk.red("MongoDB connection crushed!")); console.log(err); reject(err) } else { console.log(chalk.green("Connected to MongoDB...")); resolve() } });