1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Fix an error when initializing the cache (#1788)

* Fix a error when initializing the cache

* Make context directory if it is not there  in initialization
This commit is contained in:
Hiroki Uchikawa 2018-07-10 20:41:16 +09:00 committed by Nick O'Leary
parent 407e16e900
commit 1bf4addf63

View File

@ -143,7 +143,13 @@ LocalFileSystem.prototype.open = function(){
self.cache.set(scope,key,data[key]);
})
});
})
}).catch(function(err){
if(err.code == 'ENOENT') {
return fs.mkdir(self.storageBaseDir);
}else{
return Promise.reject(err);
}
});
} else {
return Promise.resolve();
}