Throw an error when input is not a JS/Elm file

This commit is contained in:
Jeroen Engels 2021-10-01 23:14:26 +02:00
parent 6e36e78637
commit c33c280e09

View File

@ -79,9 +79,7 @@ export async function run(
process.exit(1) process.exit(1)
} }
} else { } else {
console.error('Please provide a path to an Elm file.'); throw new Error('Please provide a path to an Elm file.\n' + program.helpInformation());
program.outputHelp();
return;
} }
if (jsSource != '') { if (jsSource != '') {
const transformed = await Transform.transform( const transformed = await Transform.transform(