From 83079b3d1a81728a0fc265db5f29995cdda1bb66 Mon Sep 17 00:00:00 2001 From: phBalance Date: Tue, 8 Oct 2019 16:34:48 -0600 Subject: [PATCH] Make sure copyToDir exists --- command_line.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/command_line.js b/command_line.js index d0b1a11..740acfd 100755 --- a/command_line.js +++ b/command_line.js @@ -1,5 +1,6 @@ 'use strict' +const fs = require("fs"); const path = require("path"); const log = require("loglevel"); @@ -77,6 +78,9 @@ try { parsed.map = []; } +// Make sure the copyToDir exists +console.assert(!parsed.copyToDir || fs.existsSync(parsed.copyToDir), `copyToDir ${parsed.copyToDir} doesn't exist`); + // Start logging log.setLevel(parsed.loglevel, false);