GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — onicode/scripts/apply-web-brand-assets.ts at main · aislopware/onicode Expand file tree/ Copy pathapply-web-brand-assets.tsMore file actions 57 lines (51 loc) · 1.95 KB / Copy pathapply-web-brand-assets.tsFile metadata and controls57 lines (51 loc) · 1.95 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 #!/usr/bin/env node import * as NodeRuntime from "@effect/platform-node/NodeRuntime"; import * as NodeServices from "@effect/platform-node/NodeServices"; import * as Effect from "effect/Effect"; import * as FileSystem from "effect/FileSystem"; import * as Option from "effect/Option"; import * as Path from "effect/Path"; import { Argument, Command } from "effect/cli"; import { resolveWebIconOverrides, type WebAssetBrand } from "./lib/brand-assets.ts"; const WEB_ASSET_BRANDS = [ "development", "production", ] as const satisfies ReadonlyArray<WebAssetBrand>; export const applyWebBrandAssets = Effect.fn("applyWebBrandAssets")(function* ( brand: WebAssetBrand, targetDirectory: string, ) { const fs = yield* FileSystem.FileSystem; const path = yield* Path.Path; const repoRoot = yield* path.fromFileUrl(new URL("..", import.meta.url)); yield* Effect.forEach( resolveWebIconOverrides(brand, path.resolve(repoRoot, targetDirectory)), (override) => fs.copyFile(path.join(repoRoot, override.sourceRelativePath), override.targetRelativePath), { concurrency: "unbounded" }, ); }); export const applyWebBrandAssetsCommand = Command.make( "apply-web-brand-assets", { brand: Argument.Literals("brand", WEB_ASSET_BRANDS).pipe( Argument.withDescription("Asset brand to copy into the built renderer."), Argument.optional, ), targetDirectory: Argument.String("target-directory").pipe( Argument.withDescription("Output directory of the built renderer."), Argument.optional, ), }, ({ brand, targetDirectory }) => applyWebBrandAssets( Option.getOrElse(brand, () => "production" as const), Option.getOrElse(targetDirectory, () => "apps/web/dist"), ), ).pipe(Command.withDescription("Copy the branded splash logo into a built renderer.")); if (import.meta.main) { Command.run(applyWebBrandAssetsCommand, { version: "0.0.0" }).pipe( Effect.provide(NodeServices.layer), NodeRuntime.runMain, ); } |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |