Dev (#158)
* fix(macos): restore main window on application reopen (#148) Handle macOS RunEvent::Reopen when no window is visible. Fixes #147. * fix(version): update core version to 7.2.138 * fix(macos): persist OAuth credentials across DMG upgrades Migrate app-bundle auth directories to Application Support before updating configuration and prevent future bundle-local OAuth storage. Fixes #153 * fix(kernel): stop the core before updating * fix(i18n): use consistent stop terminology for core controls * fix(opencode): support macOS JSONC configuration detection Closes #156 * fix(update): preserve legacy macOS manifest compatibility --------- Co-authored-by: Fake Trader <9635792+faketrader@users.noreply.github.com>
This commit is contained in:
1 parent
57c5f5d774
commit
b15773b0f4
2 files changed
+32
-14
No files matched your search
+25
-13
@@ -9,12 +9,20 @@ export function portableUpdateManifestName(platform) {
|
||||
if (!['windows', 'linux', 'darwin'].includes(normalizedPlatform)) {
|
||||
throw new Error(`Unsupported update platform: ${platform}`);
|
||||
}
|
||||
// Keep the broken legacy macOS updater on a manifest URL that is no longer published.
|
||||
// New macOS builds use a separate channel because the signed-bundle updater
|
||||
// requires the newer update flow.
|
||||
return normalizedPlatform === 'darwin'
|
||||
? 'portable-update-darwin-v2.json'
|
||||
: `portable-update-${normalizedPlatform}.json`;
|
||||
}
|
||||
|
||||
export function portableUpdateManifestNames(platform) {
|
||||
const primaryName = portableUpdateManifestName(platform);
|
||||
return primaryName === 'portable-update-darwin-v2.json'
|
||||
? [primaryName, 'portable-update-darwin.json']
|
||||
: [primaryName];
|
||||
}
|
||||
|
||||
export async function generatePortableUpdateManifest({
|
||||
directory,
|
||||
output,
|
||||
@@ -113,18 +121,22 @@ async function main() {
|
||||
}
|
||||
const directory = resolve(args.get('--directory') ?? 'artifacts');
|
||||
const platform = args.get('--platform') ?? 'windows';
|
||||
const output = resolve(
|
||||
args.get('--output') ?? join(directory, portableUpdateManifestName(platform)),
|
||||
);
|
||||
const manifest = await generatePortableUpdateManifest({
|
||||
directory,
|
||||
output,
|
||||
platform,
|
||||
repository: args.get('--repository'),
|
||||
gitcodeRepository: args.get('--gitcode-repository'),
|
||||
tag: args.get('--tag'),
|
||||
});
|
||||
console.log(`Generated ${basename(output)} for v${manifest.version}`);
|
||||
const requestedOutput = args.get('--output');
|
||||
const outputs = requestedOutput
|
||||
? [resolve(requestedOutput)]
|
||||
: portableUpdateManifestNames(platform).map((name) => join(directory, name));
|
||||
let manifest;
|
||||
for (const output of outputs) {
|
||||
manifest = await generatePortableUpdateManifest({
|
||||
directory,
|
||||
output,
|
||||
platform,
|
||||
repository: args.get('--repository'),
|
||||
gitcodeRepository: args.get('--gitcode-repository'),
|
||||
tag: args.get('--tag'),
|
||||
});
|
||||
}
|
||||
console.log(`Generated ${outputs.map(basename).join(', ')} for v${manifest.version}`);
|
||||
}
|
||||
|
||||
const entryPoint = process.argv[1] ? pathToFileURL(resolve(process.argv[1])).href : '';
|
||||
|
||||
@@ -6,12 +6,18 @@ import { describe, expect, test } from 'bun:test';
|
||||
import {
|
||||
generatePortableUpdateManifest,
|
||||
portableUpdateManifestName,
|
||||
portableUpdateManifestNames,
|
||||
} from '../scripts/manifest.mjs';
|
||||
|
||||
test('macOS uses a new update manifest channel', () => {
|
||||
test('macOS uses a new primary channel and keeps the legacy manifest alias', () => {
|
||||
expect(portableUpdateManifestName('windows')).toBe('portable-update-windows.json');
|
||||
expect(portableUpdateManifestName('linux')).toBe('portable-update-linux.json');
|
||||
expect(portableUpdateManifestName('darwin')).toBe('portable-update-darwin-v2.json');
|
||||
expect(portableUpdateManifestNames('darwin')).toEqual([
|
||||
'portable-update-darwin-v2.json',
|
||||
'portable-update-darwin.json',
|
||||
]);
|
||||
expect(portableUpdateManifestNames('linux')).toEqual(['portable-update-linux.json']);
|
||||
});
|
||||
|
||||
describe('Windows 便携更新清单', () => {
|
||||
|
||||
Reference in new issue
Block a user