diff options
Diffstat (limited to 'src/commands')
| -rw-r--r-- | src/commands/check.ts | 19 | ||||
| -rw-r--r-- | src/commands/config.ts | 19 |
2 files changed, 38 insertions, 0 deletions
diff --git a/src/commands/check.ts b/src/commands/check.ts new file mode 100644 index 0000000..cfa3cb1 --- /dev/null +++ b/src/commands/check.ts @@ -0,0 +1,19 @@ +import type { Command } from "commander"; +import { checkDependencies } from "../actions/checkDependencies.js"; +import { outputSummary } from "../actions/outputSummary.js"; +import { sendAuditEmail } from "../actions/sendEmail.js"; + +export const check = (program: Command) => { + program + .command("check") + .description("Checks given repos for security updates and logs output.") + .option("-e, --email", "Send Email Report via the configured Email.") + .action(async (cmd) => { + const data = await checkDependencies(); + if (cmd.email) { + sendAuditEmail(data); + } else { + outputSummary(data); + } + }); +}; diff --git a/src/commands/config.ts b/src/commands/config.ts new file mode 100644 index 0000000..c888766 --- /dev/null +++ b/src/commands/config.ts @@ -0,0 +1,19 @@ +import type { Command } from "commander"; +import { initConfig } from "../utils/config.js"; + +export const config = (program: Command) => { + program + .command("config") + .argument("<action>") + .action(async (action: string) => { + switch (action) { + case "init": + await initConfig(); + break; + default: + console.log( + "No valid action. These are valid: init. More comming soon...", + ); + } + }); +}; |
