Skip to content

Commit

Permalink
Merge pull request #1322 from MALSync/only-keep-last-five-diffurls
Browse files Browse the repository at this point in the history
only keep last 5 diffurls
  • Loading branch information
lolamtisch committed Oct 1, 2022
2 parents 007335e + deb00ca commit f32d656
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions webpackConfig/missingPermissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ async function main() {
const currentData = JSON.parse(data);
currentData[version] = diffUrls;

if(Object.keys(currentData).length > 5) {
const remove = Object.keys(currentData).slice(0, Object.keys(currentData).length - 5);

for(const item of remove) {
delete currentData[item];
}
}

fs.writeFile(descFile, JSON.stringify(currentData, null, 2), 'utf8', function (err) {
if (err) throw err;
});
Expand Down

0 comments on commit f32d656

Please sign in to comment.