Skip to content

Commit 7997e6b

Browse files
committed
Improved display of verification results.
1 parent ebfed90 commit 7997e6b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

typescript/verify.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ async function verify(name, directory) {
4848

4949
let diagnostics = await compile(path.join(directory, 'tsconfig.json'));
5050
let success = diagnostics.length === 0;
51+
let report = `\x1b${success ? '[32m✔' : '[31mX'}\x1b[0m`;
5152

52-
process.stdout.write(
53-
`\x1b[${line.length}D\x1b${success ? '[32m✔' : '[31mX'}\x1b[0m ${name} \n`
54-
);
53+
if (process.stdout.isTTY) {
54+
process.stdout.write(`\x1b[${line.length}D${report} ${name} \n`);
55+
} else {
56+
process.stdout.write(` ${report}\n`);
57+
}
5558

5659
if (!success) {
5760
printDiagnostics(diagnostics);

0 commit comments

Comments
 (0)