1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-15 00:37:20 +08:00

Opt: AP preserve until reset

This commit is contained in:
sui-feng-cb
2025-09-03 13:59:51 +08:00
parent c3856ae101
commit 6b0383a169
137 changed files with 9982 additions and 13706 deletions

View File

@@ -12,13 +12,14 @@ const path = require('path');
*/
function getVendors() {
const output = execSync(`${electron} -p "JSON.stringify(process.versions)"`, {
env: {ELECTRON_RUN_AS_NODE: '1'},
env: {'ELECTRON_RUN_AS_NODE': '1'},
encoding: 'utf-8',
});
return JSON.parse(output);
}
function formattedJSON(obj) {
return JSON.stringify(obj, null, 2) + '\n';
}
@@ -32,25 +33,22 @@ function updateVendors() {
const packageJSONPath = path.resolve(process.cwd(), 'package.json');
return Promise.all([
writeFile(
'./electron-vendors.config.json',
writeFile('./electron-vendors.config.json',
formattedJSON({
chrome: chromeMajorVersion,
node: nodeMajorVersion,
}),
),
readFile(packageJSONPath)
.then(JSON.parse)
.then(packageJSON => {
if (!packageJSON || !Array.isArray(packageJSON.browserslist)) {
throw new Error(`Can't find browserslist in ${packageJSONPath}`);
}
readFile(packageJSONPath).then(JSON.parse).then((packageJSON) => {
if (!packageJSON || !Array.isArray(packageJSON.browserslist)) {
throw new Error(`Can't find browserslist in ${packageJSONPath}`);
}
packageJSON.browserslist = [`Chrome ${chromeMajorVersion}`];
packageJSON.browserslist = [`Chrome ${chromeMajorVersion}`];
return writeFile(packageJSONPath, formattedJSON(packageJSON));
}),
return writeFile(packageJSONPath, formattedJSON(packageJSON));
}),
]);
}