The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | #!/usr/bin/env node |
| 2 | |
| 3 | // Runs the native-load probes a cross-built Windows desktop artifact skipped, |
| 4 | // on a host of the target's architecture. |
| 5 | |
| 6 | import * as NodeRuntime from "@effect/platform-node/NodeRuntime"; |
| 7 | import * as NodeServices from "@effect/platform-node/NodeServices"; |
| 8 | import * as Effect from "effect/Effect"; |
| 9 | import * as Layer from "effect/Layer"; |
| 10 | import * as Logger from "effect/Logger"; |
| 11 | import { Command, Flag } from "effect/cli"; |
| 12 | |
| 13 | import { |
| 14 | resolveDesktopProductName, |
| 15 | verifyWindowsPackagedRuntime, |
| 16 | } from "./build-desktop-artifact.ts"; |
| 17 | |
| 18 | const verifyWindowsDesktopArtifactCli = Command.make("verify-windows-desktop-artifact", { |
| 19 | appDir: Flag.String("app-dir").pipe( |
| 20 | Flag.withDescription("The electron-builder `win-<arch>-unpacked` directory."), |
| 21 | ), |
| 22 | arch: Flag.Literals("arch", ["arm64", "x64"] as const), |
| 23 | buildVersion: Flag.String("build-version").pipe( |
| 24 | Flag.withDescription("The artifact's build version."), |
| 25 | ), |
| 26 | verbose: Flag.Boolean("verbose").pipe(Flag.withDefault(false)), |
| 27 | }).pipe( |
| 28 | Command.withDescription("Verify a Windows desktop artifact's packaged natives load."), |
| 29 | Command.withHandler(({ appDir, arch, buildVersion, verbose }) => |
| 30 | Effect.gen(function* () { |
| 31 | yield* verifyWindowsPackagedRuntime({ |
| 32 | packagedAppDir: appDir, |
| 33 | appExecutableName: `${resolveDesktopProductName(buildVersion)}.exe`, |
| 34 | targetArch: arch, |
| 35 | verbose, |
| 36 | }); |
| 37 | yield* Effect.log(`[verify-windows-desktop-artifact] ${appDir} passed.`); |
| 38 | }), |
| 39 | ), |
| 40 | ); |
| 41 | |
| 42 | // No import.meta.main guard: CI bundles this file into one module together with |
| 43 | // build-desktop-artifact.ts, whose own guard is defined false in that bundle. |
| 44 | Command.run(verifyWindowsDesktopArtifactCli, { version: "0.0.0" }).pipe( |
| 45 | Effect.scoped, |
| 46 | Effect.provide(Layer.mergeAll(Logger.layer([Logger.consolePretty()]), NodeServices.layer)), |
| 47 | NodeRuntime.runMain, |
| 48 | ); |