Skip to content

Commit a8ac485

Browse files
committed
add error message
1 parent 5ff28ac commit a8ac485

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

packages/flowtest-cli/bin/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,13 @@ const argv = yargs(hideBin(process.argv))
4646
async (argv) => {
4747
console.log(`Reading file: ${argv.file}`);
4848
if (argv.file.toLowerCase().endsWith(`.flow`)) {
49-
const content = readFile(argv.file);
49+
let content = undefined;
50+
try {
51+
content = readFile(argv.file);
52+
} catch (error) {
53+
console.error(chalk.red(`${error}`));
54+
process.exit(1);
55+
}
5056
try {
5157
const flowData = serialize(JSON.parse(content));
5258
// output json output to a file

0 commit comments

Comments
 (0)