GDBrowser/icons/parsePlist.js
101arrowz 43358b74af Major improvements to icon generation
101arrowz made some awesome improvements to my spaghetticode in icon.js!
2019-10-20 15:21:16 -04:00

12 lines
No EOL
497 B
JavaScript

const plist = require('plist');
const { readFileSync, writeFileSync } = require('fs');
const data = plist.parse(readFileSync('./GJ_GameSheet02-uhd.plist', 'utf8'));
for (let key in data.frames) {
let fileData = data.frames[key];
for (let innerKey in fileData) {
if (typeof fileData[innerKey] === 'string') {
fileData[innerKey] = JSON.parse(fileData[innerKey].replace(/{/g, '[').replace(/}/g, ']'));
}
}
}
writeFileSync('./gameSheet.json', JSON.stringify(data.frames, null, 2));