Skip to content

Commit

Permalink
Move createDir out of config() for wider use
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBlueHat committed May 31, 2017
1 parent e94df7d commit 7077aa1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ function getConfigFile(configFile){
return config;
}

function createDir(path) {
if (!fs.existsSync(path)) {
fs.mkdirSync(path);
}
}

function config(configFile){
var config = getConfigFile(configFile);

Expand All @@ -165,12 +171,6 @@ function config(configFile){
config['maxResourceCount'] = config.maxResourceCount || 100;
config['proxyURL'] = config.proxyURL || 'https://dokie.li/proxy?uri=';

function createDir(path) {
if (!fs.existsSync(path)) {
fs.mkdirSync(path);
}
}

// create the `rootPath` directory
createDir(config['rootPath']);
// ...all others are relative to `rootPath`
Expand Down

0 comments on commit 7077aa1

Please sign in to comment.