Skip to content

Commit 3992c57

Browse files
committed
feat(cli): set command
1 parent b5e00f2 commit 3992c57

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/bin.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { PackageJson } from 'type-fest'
55

66
import { init } from './commands/init'
77
import { install } from './commands/install'
8-
import { add } from './commands/set_add'
8+
import { add, set } from './commands/set_add'
99
import { uninstall } from './commands/uninstall'
1010

1111
function readPkg(): PackageJson {
@@ -37,6 +37,10 @@ Examples
3737
husky install
3838
husky install .config/husky
3939
40+
husky set .husky/pre-commit
41+
husky set .husky/pre-commit "npm test"
42+
husky set .config/husky/pre-commit "npm test"
43+
4044
husky add .husky/pre-commit
4145
husky add .husky/pre-commit "npm test"
4246
husky add .config/husky/pre-commit "npm test"
@@ -63,6 +67,14 @@ switch (cmd) {
6367
uninstall()
6468
break
6569
}
70+
case 'set': {
71+
if (args.length === 0 || args.length > 2) {
72+
help()
73+
process.exit(2)
74+
}
75+
set(args[0], args[1])
76+
break
77+
}
6678
case 'add': {
6779
if (args.length === 0 || args.length > 2) {
6880
help()

0 commit comments

Comments
 (0)