mirror of
https://github.com/webadderallorg/Recordly.git
synced 2026-09-24 06:46:09 +00:00
chore(ci): address quality review feedback
This commit is contained in:
@@ -47,6 +47,11 @@ jobs:
|
||||
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
|
||||
run: npm run lint
|
||||
|
||||
- name: Check formatting (advisory)
|
||||
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
|
||||
continue-on-error: true
|
||||
run: npm run format:check
|
||||
|
||||
- name: Test
|
||||
if: ${{ !cancelled() && steps.install.outcome == 'success' }}
|
||||
run: npm test
|
||||
|
||||
@@ -27,6 +27,14 @@ describe("Windows native helper path resolution", () => {
|
||||
await fs.rm(tempRoot, { recursive: true, force: true });
|
||||
});
|
||||
|
||||
it("resolves a requested platform tag independently of the host platform", async () => {
|
||||
const { getNativeArchTag } = await import("./binaries");
|
||||
|
||||
expect(getNativeArchTag("win32")).toBe(
|
||||
process.arch === "arm64" ? "win32-arm64" : "win32-x64",
|
||||
);
|
||||
});
|
||||
|
||||
it("prefers the branch-staged helper over a stale local CMake build in dev", async () => {
|
||||
const buildOutputPath = path.join(
|
||||
appPath,
|
||||
|
||||
@@ -29,31 +29,33 @@ export function getNativeCaptureHelperSourcePath(): string {
|
||||
return resolveUnpackedAppPath("electron", "native", "ScreenCaptureKitRecorder.swift");
|
||||
}
|
||||
|
||||
export function getNativeArchTag(): string {
|
||||
if (process.platform === "darwin") {
|
||||
export function getNativeArchTag(platform: NodeJS.Platform = process.platform): string {
|
||||
if (platform === "darwin") {
|
||||
return process.arch === "arm64" ? "darwin-arm64" : "darwin-x64";
|
||||
}
|
||||
|
||||
if (process.platform === "win32") {
|
||||
if (platform === "win32") {
|
||||
return process.arch === "arm64" ? "win32-arm64" : "win32-x64";
|
||||
}
|
||||
|
||||
if (process.platform === "linux") {
|
||||
if (platform === "linux") {
|
||||
return process.arch === "arm64" ? "linux-arm64" : "linux-x64";
|
||||
}
|
||||
|
||||
return `${process.platform}-${process.arch}`;
|
||||
return `${platform}-${process.arch}`;
|
||||
}
|
||||
|
||||
export function getPrebundledNativeHelperPath(binaryName: string): string {
|
||||
return resolveUnpackedAppPath("electron", "native", "bin", getNativeArchTag(), binaryName);
|
||||
export function getPrebundledNativeHelperPath(
|
||||
binaryName: string,
|
||||
archTag = getNativeArchTag(),
|
||||
): string {
|
||||
return resolveUnpackedAppPath("electron", "native", "bin", archTag, binaryName);
|
||||
}
|
||||
|
||||
export function resolvePreferredWindowsNativeHelperPath(
|
||||
helperDirectory: string,
|
||||
binaryName: string,
|
||||
): string {
|
||||
const windowsArchTag = process.arch === "arm64" ? "win32-arm64" : "win32-x64";
|
||||
const buildOutputPath = resolveUnpackedAppPath(
|
||||
"electron",
|
||||
"native",
|
||||
@@ -62,13 +64,7 @@ export function resolvePreferredWindowsNativeHelperPath(
|
||||
"Release",
|
||||
binaryName,
|
||||
);
|
||||
const prebundledPath = resolveUnpackedAppPath(
|
||||
"electron",
|
||||
"native",
|
||||
"bin",
|
||||
windowsArchTag,
|
||||
binaryName,
|
||||
);
|
||||
const prebundledPath = getPrebundledNativeHelperPath(binaryName, getNativeArchTag("win32"));
|
||||
|
||||
if (app.isPackaged && existsSync(prebundledPath)) {
|
||||
return prebundledPath;
|
||||
|
||||
Reference in New Issue
Block a user