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,
|
args: Bun.argv,
|
||||||
options: {
|
options: {
|
||||||
indir: {
|
indir: {
|
||||||
@ -47,6 +47,10 @@ const { values: { indir: inDir, common: commonDir, revision: rev, outdir: outDir
|
|||||||
type: "string",
|
type: "string",
|
||||||
short: "o",
|
short: "o",
|
||||||
default: "dist"
|
default: "dist"
|
||||||
|
},
|
||||||
|
info: {
|
||||||
|
type: "string",
|
||||||
|
default: "info.json"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
strict: true,
|
strict: true,
|
||||||
@ -66,7 +70,7 @@ if (!await directoryExists(dir)) {
|
|||||||
process.exit(1);
|
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 common = resolve(dir, commonDir!);
|
||||||
const dist = resolve(dir, outDir!);
|
const dist = resolve(dir, outDir!);
|
||||||
if (!await directoryExists(common)) {
|
if (!await directoryExists(common)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user