From 6fddd8039f736a5f8cd36bc6cfd04ed4c85bbc0f Mon Sep 17 00:00:00 2001 From: Donovan Daniels Date: Thu, 30 May 2024 14:06:16 -0500 Subject: [PATCH] Allow specifying `info` file --- index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/index.ts b/index.ts index 7171283..ae4a799 100644 --- a/index.ts +++ b/index.ts @@ -26,7 +26,7 @@ interface Info { } -const { values: { indir: inDir, common: commonDir, revision: rev, outdir: outDir } } = parseArgs({ +const { values: { indir: inDir, common: commonDir, revision: rev, outdir: outDir, info: infoPath } } = parseArgs({ args: Bun.argv, options: { indir: { @@ -47,6 +47,10 @@ const { values: { indir: inDir, common: commonDir, revision: rev, outdir: outDir type: "string", short: "o", default: "dist" + }, + info: { + type: "string", + default: "info.json" } }, strict: true, @@ -66,7 +70,7 @@ if (!await directoryExists(dir)) { process.exit(1); } -const info = await Bun.file(`${dir}/info.json`).json() as Info; +const info = await Bun.file(infoPath ?? "info.json").json() as Info; const common = resolve(dir, commonDir!); const dist = resolve(dir, outDir!); if (!await directoryExists(common)) {