summaryrefslogtreecommitdiff
path: root/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands')
-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);
+ });
+};