mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-13 20:56:19 -08:00
ci(nightly): resolve both config rewrites before writing either
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
0c9403baf8
commit
047094a181
1 file changed
+18
-9
@@ -264,20 +264,29 @@ function main(argv) {
|
||||
}
|
||||
|
||||
if (options.apply) {
|
||||
writeFileSync(
|
||||
packageJsonPath,
|
||||
applyNightlyVersion(packageJsonText, version)
|
||||
);
|
||||
// Resolve both replacements before touching either file, so a bad
|
||||
// electron-builder.json cannot leave package.json half-applied.
|
||||
const electronBuilderJsonPath = new URL(
|
||||
'../../electron-builder.json',
|
||||
import.meta.url
|
||||
);
|
||||
writeFileSync(
|
||||
electronBuilderJsonPath,
|
||||
applyNightlyPublishChannel(
|
||||
let nextPackageJson;
|
||||
let nextElectronBuilderJson;
|
||||
|
||||
try {
|
||||
nextPackageJson = applyNightlyVersion(packageJsonText, version);
|
||||
nextElectronBuilderJson = applyNightlyPublishChannel(
|
||||
readFileSync(electronBuilderJsonPath, 'utf8')
|
||||
)
|
||||
);
|
||||
);
|
||||
} catch (error) {
|
||||
console.error(
|
||||
error instanceof Error ? error.message : String(error)
|
||||
);
|
||||
return 1;
|
||||
}
|
||||
|
||||
writeFileSync(packageJsonPath, nextPackageJson);
|
||||
writeFileSync(electronBuilderJsonPath, nextElectronBuilderJson);
|
||||
console.error(
|
||||
`Applied nightly version ${version} to package.json and the nightly publish channel to electron-builder.json.`
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user