2026-08-15 18:37:30 +02:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
const args = process.argv.slice(2);
|
|
|
|
|
|
|
|
|
|
function getArg(name) {
|
|
|
|
|
const index = args.indexOf(name);
|
|
|
|
|
return index === -1 ? undefined : args[index + 1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const targetDir = getArg("--dir");
|
|
|
|
|
const olderThanDays = getArg("--days");
|
|
|
|
|
const types = getArg("--types");
|
|
|
|
|
|
2026-08-16 13:55:25 +02:00
|
|
|
console.log(
|
|
|
|
|
`Scanning ${targetDir} for files older than ${olderThanDays} days (types: ${types})`,
|
|
|
|
|
);
|
2026-08-15 18:37:30 +02:00
|
|
|
if (process.env.CLEANUP_API_KEY) {
|
|
|
|
|
console.log("Using configured external API key.");
|
|
|
|
|
}
|
|
|
|
|
console.log("No matching files found. Cleanup complete.");
|