2021-09-09 21:49:01 +00:00
|
|
|
// Use this script to regenerate these fixture files
|
|
|
|
// using a new version of the asar package
|
|
|
|
|
2022-10-19 20:39:31 +00:00
|
|
|
const asar = require('@electron/asar');
|
2023-06-15 14:42:27 +00:00
|
|
|
const fs = require('node:fs');
|
|
|
|
const os = require('node:os');
|
|
|
|
const path = require('node:path');
|
2021-09-09 21:49:01 +00:00
|
|
|
|
|
|
|
const archives = [];
|
|
|
|
for (const child of fs.readdirSync(__dirname)) {
|
|
|
|
if (child.endsWith('.asar')) {
|
|
|
|
archives.push(path.resolve(__dirname, child));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (const archive of archives) {
|
|
|
|
const tmp = fs.mkdtempSync(path.resolve(os.tmpdir(), 'asar-spec-'));
|
|
|
|
asar.extractAll(archive, tmp);
|
|
|
|
asar.createPackageWithOptions(tmp, archive, {
|
|
|
|
unpack: fs.existsSync(archive + '.unpacked') ? '*' : undefined
|
|
|
|
});
|
|
|
|
}
|