Prepare 0.1.42 macOS Apple silicon release
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { mkdtemp, mkdir, writeFile, readFile, readdir, chmod, rm, stat } from 'node:fs/promises';
|
||||
import { mkdtemp, mkdir, writeFile, readFile, readdir, chmod, rm, stat, symlink, rename } from 'node:fs/promises';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { stageRuntime } from '../scripts/stage-runtime.mjs';
|
||||
@@ -37,6 +37,26 @@ test('missing source leaves the previous runtime intact', async t => {
|
||||
assert.equal(await readFile(join(options.destination, 'RuneStone-Browser.exe'), 'utf8'), 'old runtime');
|
||||
});
|
||||
|
||||
test('macOS staging preserves the app bundle and executable layout', async t => {
|
||||
const options = await fixture(t);
|
||||
const source = join(options.project, 'dist/RuneStone-Browser-darwin-arm64');
|
||||
const executable = 'RuneStone-Browser.app/Contents/MacOS/RuneStone-Browser';
|
||||
await mkdir(join(source, 'RuneStone-Browser.app/Contents/MacOS'), { recursive: true });
|
||||
await writeFile(join(source, executable), 'macOS fixture', { mode: 0o755 });
|
||||
await writeFile(join(source, 'RuneStone-Browser.app/Contents/Info.plist'), 'bundle metadata');
|
||||
if (process.platform !== 'win32') {
|
||||
await symlink('../Info.plist', join(source, 'RuneStone-Browser.app/Contents/MacOS/metadata'));
|
||||
}
|
||||
const result = await stageRuntime({ ...options, platform: 'darwin', arch: 'arm64' });
|
||||
await rename(source, `${source}-moved`);
|
||||
assert.equal(await readFile(join(result.destination, executable), 'utf8'), 'macOS fixture');
|
||||
assert.equal(await readFile(join(result.destination, 'RuneStone-Browser.app/Contents/Info.plist'), 'utf8'), 'bundle metadata');
|
||||
assert.equal(await readFile(join(result.backup, 'RuneStone-Browser.exe'), 'utf8'), 'old runtime');
|
||||
if (process.platform !== 'win32') {
|
||||
assert.equal(await readFile(join(result.destination, 'RuneStone-Browser.app/Contents/MacOS/metadata'), 'utf8'), 'bundle metadata');
|
||||
}
|
||||
});
|
||||
|
||||
test('Linux staging rejects a non-executable runtime before replacing the old tree', { skip: process.platform === 'win32' }, async t => {
|
||||
const options = await fixture(t);
|
||||
await chmod(join(options.source, 'RuneStone-Browser'), 0o644);
|
||||
|
||||
Reference in New Issue
Block a user