recordify: catch NaN --count-file

This commit is contained in:
Starbeamrainbowlabs 2022-11-01 19:53:21 +00:00
parent c17a4ca05a
commit 784b8ed35c
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -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 });