From 7e5acf10bc4186cacaae7b8c5a31280d392305ef Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Sat, 19 Oct 2024 23:48:57 -0700 Subject: [PATCH] chore: add --out flag to build_Cross.ts --- scripts/build/build_cross.ts | 11 ++++++++--- scripts/deno.lock | 4 ++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/build/build_cross.ts b/scripts/build/build_cross.ts index 39b91b88..500e195f 100755 --- a/scripts/build/build_cross.ts +++ b/scripts/build/build_cross.ts @@ -1,5 +1,6 @@ #!/usr/bin/env -S deno run -A +import { parseArgs } from "jsr:@std/cli/parse-args"; import { resolve } from "jsr:@std/path"; import { ensureDir } from "jsr:@std/fs"; @@ -221,7 +222,11 @@ export async function buildCross(outDir: string, packages: string[] = []) { } if (import.meta.main) { - const dir = await Deno.makeTempDir(); - console.log(dir); - await buildCross(dir); + const flags = parseArgs(Deno.args, { string: ["out"] }); + const outDir = flags.out; + if (!outDir) { + console.error("Missing --out"); + Deno.exit(1); + } + await buildCross(outDir); } diff --git a/scripts/deno.lock b/scripts/deno.lock index 0e75d364..fb844a75 100644 --- a/scripts/deno.lock +++ b/scripts/deno.lock @@ -3,6 +3,7 @@ "packages": { "specifiers": { "jsr:@std/assert": "jsr:@std/assert@1.0.6", + "jsr:@std/cli": "jsr:@std/cli@1.0.6", "jsr:@std/fs": "jsr:@std/fs@1.0.4", "jsr:@std/fs@^1.0.4": "jsr:@std/fs@1.0.4", "jsr:@std/internal@^1.0.4": "jsr:@std/internal@1.0.4", @@ -19,6 +20,9 @@ "jsr:@std/internal@^1.0.4" ] }, + "@std/cli@1.0.6": { + "integrity": "d22d8b38c66c666d7ad1f2a66c5b122da1704f985d3c47f01129f05abb6c5d3d" + }, "@std/fs@1.0.4": { "integrity": "2907d32d8d1d9e540588fd5fe0ec21ee638134bd51df327ad4e443aaef07123c", "dependencies": [