break;
case "cachedir":
- console.log("Cache dir set to: ", line_real[1]);
- global.repoproxy.cacheDir = line_real[1];
-
+ var tmppath = line_real[1].replace(/\/+/g, "/");
+ console.log("Cache dir set to: ", tmppath);
+ global.repoproxy.cacheDir = tmppath;
break;
case "listenport":
console.log("Port set to: ", line_real[1]);
} catch(e) {
try {
fs.mkdirSync(global.repoproxy.cacheDir);
+ fs.mkdirSync(global.repoproxy.cacheDir + "/.cleanup");
} catch(ex) {
console.log("ERROR: failure to create cache directory, '%s'", global.repoproxy.cacheDir);
}
}
+ try {
+ fs.mkdirSync(global.repoproxy.cacheDir + "/.cleanup");
+ } catch(ex) {
+ console.log("ERROR: cant create cleanup directory, '%s'", global.repoproxy.cacheDir + "/.cleanup");
+ }
+
for(var index in global.repoproxy.repo) {
var fullDir = global.repoproxy.cacheDir + "/" + index;
try {