-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleanup-report.mjs
More file actions
23 lines (19 loc) · 857 Bytes
/
Copy pathcleanup-report.mjs
File metadata and controls
23 lines (19 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env node
import { resolve } from "node:path";
import { collectCleanupReport, formatCleanupReport } from "./cleanup-report-lib.mjs";
const HELP = `Usage: npm run cleanup:report -- [--json]
Reports counts, sizes, and age for .release-tmp/, .native-test-data/, and known
timestamped agent.ts backups. The scan is read-only and bounded to those paths.
This command has no removal mode.
`;
const args = process.argv.slice(2);
if (args.includes("--help") || args.includes("-h")) {
process.stdout.write(HELP);
process.exit(0);
}
if (args.some((arg) => arg !== "--json")) {
process.stderr.write(`${HELP}\nUnknown option.\n`);
process.exit(2);
}
const report = await collectCleanupReport(resolve(import.meta.dirname, ".."));
process.stdout.write(args.includes("--json") ? `${JSON.stringify(report, null, 2)}\n` : formatCleanupReport(report));