Use ensureDir() insted of mkdir()

and add test case
This commit is contained in:
HirokiUchikawa
2018-07-12 18:20:47 +09:00
parent fc9040f715
commit 9111adf15f
2 changed files with 122 additions and 1 deletions

View File

@@ -145,7 +145,7 @@ LocalFileSystem.prototype.open = function(){
});
}).catch(function(err){
if(err.code == 'ENOENT') {
return fs.mkdir(self.storageBaseDir);
return fs.ensureDir(self.storageBaseDir);
}else{
return Promise.reject(err);
}