Allow specifying info
file
This commit is contained in:
parent
e742d839e1
commit
6fddd8039f
8
index.ts
8
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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user