From aa93809b12c46cdfc27231593d092e9bef1b5868 Mon Sep 17 00:00:00 2001 From: rozetko Date: Fri, 21 Sep 2018 16:45:14 +0300 Subject: [PATCH] Check for exported directory #6 --- src/config.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/config.ts b/src/config.ts index 6d5bf3a..b847c17 100644 --- a/src/config.ts +++ b/src/config.ts @@ -2,7 +2,10 @@ import * as path from 'path'; import * as fs from 'fs'; export const EXPORTED_PATH = path.join(__dirname, '../exported'); - +if(!fs.existsSync(EXPORTED_PATH)) { + console.log(`${EXPORTED_PATH} don't exist, creating`); + fs.mkdirSync(EXPORTED_PATH); +} export function getApiKey(host) { let data = fs.readFileSync(path.join(__dirname, '../api-keys.json'), 'utf8');