Skip to content

Commit

Permalink
add robust to fix #12
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty472123 committed Mar 24, 2018
1 parent dda2fe3 commit af0c059
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions wuConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function doConfig(configFile,cb){
app={pages:k,window:e.global.window,tabBar:e.tabBar,networkTimeout:e.networkTimeout};
if(typeof e.debug!="undefined")app.debug=e.debug;
for(let a in e.page)wu.save(path.resolve(dir,wu.changeExt(a,".json")),JSON.stringify(e.page[a].window,null,4));
wu.scanDirByExt(dir,"",li=>{//search all files
if(app.tabBar&&app.tabBar.list) wu.scanDirByExt(dir,"",li=>{//search all files
let digests=[],digestsEvent=new wu.CntEvent,rdir=path.resolve(dir);
function fixDir(dir){return dir.startsWith(rdir)?dir.slice(rdir.length+1):dir;}
digestsEvent.add(()=>{
Expand Down Expand Up @@ -40,7 +40,10 @@ function doConfig(configFile,cb){
digestsEvent.decount();
},{});
}
});
});else{
wu.save(path.resolve(dir,'app.json'),JSON.stringify(app,null,4));
cb({[configFile]:8});
}
});
}
module.exports={doConfig:doConfig};
Expand Down

0 comments on commit af0c059

Please sign in to comment.