import { detectCron, detectedJobsToRouteScheduleManifest } from "./detect-cron";
import { updateCron } from "./update-cron";
export default function registerCI(program) {
    program
        .command("ci [cwd]")
        .description("Detects & registers cron jobs.")
        .option("-d, --dry-run", "Only detect, don't update.", false)
        .option("-p, --production", "Use production config.", false)
        .action(quirrelCI);
}
export async function quirrelCI(cwd = process.cwd(), { dryRun, production }) {
    const detectedJobs = await detectCron(cwd);
    const routeScheduleMap = detectedJobsToRouteScheduleManifest(detectedJobs);
    await updateCron(routeScheduleMap, dryRun, production);
}
//# sourceMappingURL=ci.js.map