"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.quirrelCI = void 0;
const detect_cron_1 = require("./detect-cron");
const update_cron_1 = require("./update-cron");
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);
}
exports.default = registerCI;
async function quirrelCI(cwd = process.cwd(), { dryRun, production }) {
    const detectedJobs = await (0, detect_cron_1.detectCron)(cwd);
    const routeScheduleMap = (0, detect_cron_1.detectedJobsToRouteScheduleManifest)(detectedJobs);
    await (0, update_cron_1.updateCron)(routeScheduleMap, dryRun, production);
}
exports.quirrelCI = quirrelCI;
//# sourceMappingURL=ci.js.map