summaryrefslogtreecommitdiff
path: root/src/commands/fix.ts
diff options
context:
space:
mode:
authorLeo Goetz <dev@leogtz.de>2026-05-24 06:50:57 +0200
committerLeo Goetz <dev@leogtz.de>2026-05-24 06:50:57 +0200
commitca8537af0ab596fddd8d72e6630f278326ef5360 (patch)
tree170d9f82b28f292f40785e33b3981121b6793c3c /src/commands/fix.ts
parentd05bfaf95fb666fea02c8aceae3ce02c9e315d3d (diff)
feat: added fix functionality
Diffstat (limited to 'src/commands/fix.ts')
-rw-r--r--src/commands/fix.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/commands/fix.ts b/src/commands/fix.ts
new file mode 100644
index 0000000..94ab2e4
--- /dev/null
+++ b/src/commands/fix.ts
@@ -0,0 +1,14 @@
+import type { Command } from "commander";
+import { fixDependencies } from "../actions/fixDependencies.js";
+import { outputFixes } from "../actions/output.js";
+
+export const fix = (program: Command) => {
+ program
+ .command("fix")
+ .description("Runs 'npm audit fix' on each project")
+ .option("-f, --force", "Uses 'npm audit fix --force' on each project")
+ .action(async (options) => {
+ let tests = await fixDependencies(options.force);
+ outputFixes(tests);
+ });
+};