From 5f756056b112081e4a3f70289d26e4b31d21d581 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Fri, 13 Jul 2018 19:49:39 -0300 Subject: [PATCH] More colors --- scripts/watcher/CommandExecutor.ts | 5 +++-- scripts/watcher/LongRunningExecutor.ts | 3 ++- scripts/watcher/SaneWatcher.ts | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/watcher/CommandExecutor.ts b/scripts/watcher/CommandExecutor.ts index fddba0b8b..195fcdcff 100644 --- a/scripts/watcher/CommandExecutor.ts +++ b/scripts/watcher/CommandExecutor.ts @@ -1,3 +1,4 @@ +import chalk from "chalk"; import spawn from "cross-spawn"; import { Cancelable, debounce } from "lodash"; @@ -65,9 +66,9 @@ export default class CommandExecutor implements Executor { child.on("close", (code: number) => { this.isRunning = false; - if (code !== 0) { + if (code !== 0 && code !== null) { // tslint:disable-next-line: no-console - console.log(`We had an error building ${code}`); + console.log(chalk.red(`Command exited with ${code}`)); } if (this.shouldRespawn) { this.spawnProcessPotentiallyDebounced(); diff --git a/scripts/watcher/LongRunningExecutor.ts b/scripts/watcher/LongRunningExecutor.ts index 7ed758ba6..358821b46 100644 --- a/scripts/watcher/LongRunningExecutor.ts +++ b/scripts/watcher/LongRunningExecutor.ts @@ -1,3 +1,4 @@ +import chalk from "chalk"; import { ChildProcess } from "child_process"; import spawn from "cross-spawn"; import { Cancelable, debounce } from "lodash"; @@ -41,7 +42,7 @@ export default class LongRunningExecutor implements Executor { if (code !== 0 && code !== null) { // tslint:disable-next-line: no-console - console.error(`Exit code returned ${code}`); + console.log(chalk.red(`Command exited with ${code}`)); return; } if (this.shouldRestart) { diff --git a/scripts/watcher/SaneWatcher.ts b/scripts/watcher/SaneWatcher.ts index 5c729ae93..1b2cbf098 100644 --- a/scripts/watcher/SaneWatcher.ts +++ b/scripts/watcher/SaneWatcher.ts @@ -1,3 +1,4 @@ +import chalk from "chalk"; import { execSync } from "child_process"; import sane from "sane"; @@ -34,7 +35,7 @@ export default class SaneWatcher implements Watcher { if (this.watchman === undefined && canUseWatchman()) { this.watchman = true; // tslint:disable-next-line:no-console - console.log("Watchman detected"); + console.log(chalk.grey(`Watchman detected`)); } }