X-Git-Url: http://git.pjr.cc/?p=nodejs-repoproxy.git;a=blobdiff_plain;f=lib%2Fconfig.js;h=7cab68a61938db63d352d3da5fdad5f7ae856740;hp=441caedc6a427a9757932ed321be9cfd2a66b34c;hb=68fbf923faf99f86cc36dc5776451f89925df8bd;hpb=d9c7eb8248208029df200a897d680914cd0f337f diff --git a/lib/config.js b/lib/config.js index 441caed..7cab68a 100644 --- a/lib/config.js +++ b/lib/config.js @@ -6,7 +6,8 @@ exports.loadConfig = function (conffile) { global.repoproxy.listenPort = 8008; global.repoproxy.cacheDir = "./cache"; global.repoproxy.repo = new Object(); - global.repoproxy.scancache = 1; + global.repoproxy.scancache = 1; + global.repoproxy.downloads = new Object(); var confFileData = fs.readFileSync(conffile, "utf8"); @@ -79,13 +80,16 @@ function createCacheStructure() { console.log("ERROR: cant create cleanup directory, '%s'", global.repoproxy.cacheDir + "/.cleanup"); } + console.log("next: ", global.repoproxy.repo); for(var index in global.repoproxy.repo) { var fullDir = global.repoproxy.cacheDir + "/" + index; + console.log("on end, ", fullDir); try { - var state = fs.statSync(global.repoproxy.cacheDir); - //console.log("state is:", state); + var state = fs.statSync(fullDir); + console.log("state is:", state); } catch(e) { try { + console.log("attempted to create cache dir, ", fullDir); fs.mkdirSync(fullDir); } catch(ex) { console.log("ERROR: failed to create cache directory, '%s' for '%s'", fullDir, index);