Files
Alberto RicartandGitHub 6966b17e8a chore: update @std imports and bump dependencies across modules (#313)
- Replaced `jsr:@std/*` imports with `@std/*` as per deno linter changes.
- Updated `@types/node` to `^24.3.1` and `typescript` to `^5.9.2`.
- Synchronized dependency versions across modules for alignment.
- Adjusted `deno.json` to reflect resolved import paths as per deno linter

Signed-off-by: Alberto Ricart <[email protected]>
2025-09-15 11:42:17 -05:00

37 lines
724 B
TypeScript

import { parseArgs } from "@std/cli";
import { Certs } from "./certs.ts";
// this tool packs a bunch of certs into a JSON file keyed after its name
const argv = parseArgs(Deno.args, {
alias: {
"d": ["dir"],
"o": ["out"],
"i": ["in"],
boolean: ["force"],
},
});
if (argv.h || argv.help) {
console.log(
"usage: cert --dir dir --out|--in json",
);
Deno.exit(0);
}
const dir = argv["dir"];
const outFile = argv["out"];
const inFile = argv["in"];
if (!dir) {
console.log("--dir is required");
Deno.exit(1);
}
if (outFile) {
const certs = await Certs.fromDir(dir);
await certs.save(outFile);
} else if (inFile) {
const certs = await Certs.fromFile(inFile);
await certs.store(dir);
}