Allow specifying info file

This commit is contained in:
Donovan Daniels 2024-05-30 14:06:16 -05:00
parent e742d839e1
commit 6fddd8039f
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA

View File

@ -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)) {