fix duplicate JS files in output

master
Gordon Williams 2023-08-07 11:31:26 +01:00
parent 34cb33f75f
commit dc3a49424e
1 changed files with 9 additions and 1 deletions

View File

@ -103,7 +103,15 @@ Promise.all(APPS.map(appid => {
var app = apploader.apps.find(a => a.id==appid); var app = apploader.apps.find(a => a.id==appid);
if (!app) throw new Error(`App ${appid} not found`); if (!app) throw new Error(`App ${appid} not found`);
return apploader.getAppFiles(app).then(files => { return apploader.getAppFiles(app).then(files => {
appfiles = appfiles.concat(files); files.forEach(f => {
var existing = appfiles.find(a=> a.name==f.name);
if (existing) {
if (existing.content !== f.content)
throw new Error(`Duplicate file ${f.name} is different`)
} else {
appfiles.push(f);
}
});
}); });
})).then(() => { })).then(() => {
// work out what goes in storage // work out what goes in storage