mirror of
https://github.com/nekename/OpenDeck.git
synced 2026-10-28 09:44:01 +00:00
22 lines
605 B
TypeScript
22 lines
605 B
TypeScript
/// <reference lib="deno.ns" />
|
|
// deno-lint-ignore-file no-import-prefix
|
|
|
|
import { copy } from "jsr:@std/fs@^1.0";
|
|
import { join } from "jsr:@std/path@^1.0";
|
|
|
|
if (Deno.args.length < 2) Deno.exit(1);
|
|
const outDir = Deno.args[0];
|
|
const target = Deno.args[1];
|
|
|
|
try {
|
|
await Deno.remove(outDir, { recursive: true });
|
|
} catch (error: any) {
|
|
if (!(error instanceof Deno.errors.NotFound)) {
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
await copy("assets", outDir);
|
|
if (!(await new Deno.Command("cargo", { args: ["install", "--path", ".", "--target", target, "--root", join(outDir, target)] }).spawn().status).success)
|
|
Deno.exit(1);
|