mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-11-29 12:46:32 +03:00
Throw an error if JS is empty
This commit is contained in:
parent
89100d5ae9
commit
5d43f746a1
@ -87,7 +87,11 @@ export async function run(
|
|||||||
} else {
|
} else {
|
||||||
throw new Error(`Please provide a path to an Elm file.\n${helpInformation}`.trim());
|
throw new Error(`Please provide a path to an Elm file.\n${helpInformation}`.trim());
|
||||||
}
|
}
|
||||||
if (jsSource != '') {
|
|
||||||
|
if (jsSource == '') {
|
||||||
|
throw new Error('Target JS file is empty.');
|
||||||
|
}
|
||||||
|
|
||||||
const transformed = await Transform.transform(
|
const transformed = await Transform.transform(
|
||||||
dirname,
|
dirname,
|
||||||
jsSource,
|
jsSource,
|
||||||
@ -109,5 +113,4 @@ export async function run(
|
|||||||
log(` ${fileName} ───> ${options.outputFilePath}`);
|
log(` ${fileName} ───> ${options.outputFilePath}`);
|
||||||
log('');
|
log('');
|
||||||
return options.outputFilePath;
|
return options.outputFilePath;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user