From c33c280e096165c7917f5ea826e99de512e6a479 Mon Sep 17 00:00:00 2001 From: Jeroen Engels Date: Fri, 1 Oct 2021 23:14:26 +0200 Subject: [PATCH] Throw an error when input is not a JS/Elm file --- src/run.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/run.ts b/src/run.ts index 2ec84fa..d2077e1 100644 --- a/src/run.ts +++ b/src/run.ts @@ -79,9 +79,7 @@ export async function run( process.exit(1) } } else { - console.error('Please provide a path to an Elm file.'); - program.outputHelp(); - return; + throw new Error('Please provide a path to an Elm file.\n' + program.helpInformation()); } if (jsSource != '') { const transformed = await Transform.transform(