Browse Source

Check for exported directory #6

pull/1/head
rozetko 6 years ago
parent
commit
aa93809b12
  1. 5
      src/config.ts

5
src/config.ts

@ -2,7 +2,10 @@ import * as path from 'path';
import * as fs from 'fs'; import * as fs from 'fs';
export const EXPORTED_PATH = path.join(__dirname, '../exported'); 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) { export function getApiKey(host) {
let data = fs.readFileSync(path.join(__dirname, '../api-keys.json'), 'utf8'); let data = fs.readFileSync(path.join(__dirname, '../api-keys.json'), 'utf8');

Loading…
Cancel
Save