Skip to content

Commit f82239c

Browse files
authored
Pretty print spawn errors instead of simply rethrowing to commander (#238)
1 parent aa74221 commit f82239c

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.changeset/salty-kiwis-turn.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"cmake-rn": patch
3+
---
4+
5+
Pretty print spawn errors instead of simply rethrowing to commander.

packages/cmake-rn/src/cli.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,16 @@ program = program.action(
217217
}
218218
} catch (error) {
219219
if (error instanceof SpawnFailure) {
220+
process.exitCode = 1;
220221
error.flushOutput("both");
222+
if (baseOptions.verbose) {
223+
console.error(
224+
`\nFailed running: ${chalk.dim(error.command, ...error.args)}\n`,
225+
);
226+
}
227+
} else {
228+
throw error;
221229
}
222-
throw error;
223230
}
224231
},
225232
);

0 commit comments

Comments
 (0)