cli: fix for error output being ignored

This commit is contained in:
Patrik Oldsberg
2020-03-06 16:23:54 +01:00
parent 427ad9c242
commit 1b7d0a4e4b
3 changed files with 12 additions and 3 deletions
+4 -1
View File
@@ -17,7 +17,10 @@ export default async (cmd: Command) => {
}
try {
spawnSync('tsc', args, { stdio: 'inherit' });
const result = spawnSync('tsc', args, { stdio: 'inherit' });
if (result.error) {
throw result.error;
}
} catch (error) {
process.stderr.write(`${chalk.red(error.message)}\n`);
process.exit(1);
+4 -1
View File
@@ -5,7 +5,10 @@ export default async () => {
const args = ['lint'];
try {
spawnSync('web-scripts', args, { stdio: 'inherit' });
const result = spawnSync('web-scripts', args, { stdio: 'inherit' });
if (result.error) {
throw result.error;
}
} catch (error) {
process.stderr.write(`${chalk.red(error.message)}\n`);
process.exit(1);
+4 -1
View File
@@ -10,7 +10,10 @@ export default async (cmd: Command) => {
}
try {
spawnSync('web-scripts', args, { stdio: 'inherit' });
const result = spawnSync('web-scripts', args, { stdio: 'inherit' });
if (result.error) {
throw result.error;
}
} catch (error) {
process.stderr.write(`${chalk.red(error.message)}\n`);
process.exit(1);