Merge pull request #384 from nofficalfs/PR-Bug-NodeFsCompat

[Bug] 修复由理电脑版的第二个兼容问题
This commit is contained in:
Spmario233 2023-09-25 17:27:51 +08:00 committed by GitHub
commit 784eb578d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -9108,11 +9108,7 @@
else if(failure == null){ else if(failure == null){
failure=()=>{}; failure=()=>{};
} }
lib.node.fs.access(dir,lib.node.fs.constants.F_OK|lib.node.fs.constants.R_OK,err=>{ try{
if(err) {
failure(err);
return;
}
lib.node.fs.readdir(dir,(err,filelist)=>{ lib.node.fs.readdir(dir,(err,filelist)=>{
if(err){ if(err){
failure(err); failure(err);
@ -9130,7 +9126,10 @@
} }
success(folders,files); success(folders,files);
}); });
}); }
catch(e){
failure(e);
}
}; };
game.ensureDirectory=function(list,callback,file){ game.ensureDirectory=function(list,callback,file){
var directorylist; var directorylist;