abec9ead06
* refactor: use node scheme imports in script * refactor: use node scheme imports in build
16 lines
463 B
JavaScript
16 lines
463 B
JavaScript
const fs = require('node:fs');
|
|
|
|
const [,, plistPath, outputPath, ...keySet] = process.argv;
|
|
|
|
const keyPairs = {};
|
|
for (let i = 0; i * 2 < keySet.length; i++) {
|
|
keyPairs[keySet[i]] = fs.readFileSync(keySet[(keySet.length / 2) + i], 'utf8');
|
|
}
|
|
|
|
let plistContents = fs.readFileSync(plistPath, 'utf8');
|
|
|
|
for (const key of Object.keys(keyPairs)) {
|
|
plistContents = plistContents.replace(`$\{${key}}`, keyPairs[key]);
|
|
}
|
|
|
|
fs.writeFileSync(outputPath, plistContents);
|