Skip to content

Commit

Permalink
feat(cli): set command
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Mar 21, 2021
1 parent b5e00f2 commit 3992c57
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/bin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { PackageJson } from 'type-fest'

import { init } from './commands/init'
import { install } from './commands/install'
import { add } from './commands/set_add'
import { add, set } from './commands/set_add'
import { uninstall } from './commands/uninstall'

function readPkg(): PackageJson {
Expand Down Expand Up @@ -37,6 +37,10 @@ Examples
husky install
husky install .config/husky
husky set .husky/pre-commit
husky set .husky/pre-commit "npm test"
husky set .config/husky/pre-commit "npm test"
husky add .husky/pre-commit
husky add .husky/pre-commit "npm test"
husky add .config/husky/pre-commit "npm test"
Expand All @@ -63,6 +67,14 @@ switch (cmd) {
uninstall()
break
}
case 'set': {
if (args.length === 0 || args.length > 2) {
help()
process.exit(2)
}
set(args[0], args[1])
break
}
case 'add': {
if (args.length === 0 || args.length > 2) {
help()
Expand Down

0 comments on commit 3992c57

Please sign in to comment.