mirror of
https://github.com/sbrl/research-rainfallradar
synced 2024-11-22 17:23:01 +00:00
recordify: catch NaN --count-file
This commit is contained in:
parent
c17a4ca05a
commit
784b8ed35c
1 changed files with 4 additions and 0 deletions
|
@ -18,6 +18,10 @@ export default async function() {
|
||||||
|
|
||||||
if(typeof settings.output !== "string")
|
if(typeof settings.output !== "string")
|
||||||
throw new Error(`Error: No output directory specified.`);
|
throw new Error(`Error: No output directory specified.`);
|
||||||
|
if(typeof settings.count_file !== "number")
|
||||||
|
throw new Error(`Error: --count-file was not specified.`);
|
||||||
|
if(isNaN(settings.count_file))
|
||||||
|
throw new Error(`Error: --count-file was not a number. process.argv: ${process.argv.join(" ")}`);
|
||||||
|
|
||||||
if(!fs.existsSync(settings.output))
|
if(!fs.existsSync(settings.output))
|
||||||
await fs.promises.mkdir(settings.output, { recursive: true });
|
await fs.promises.mkdir(settings.output, { recursive: true });
|
||||||
|
|
Loading…
Reference in a new issue