Skip to content

Commit

Permalink
feat(cli): toggle
Browse files Browse the repository at this point in the history
Signed-off-by: Lexus Drumgold <[email protected]>
  • Loading branch information
unicornware committed Oct 2, 2022
1 parent 5831bb5 commit 508f175
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
"release": "bash ./scripts/release.sh",
"test": "vitest run",
"test:cov": "yarn test --coverage",
"test:watch": "vitest",
"toggle-pkg-type": "node --loader=./loader.mjs ./src/cli"
"test:watch": "vitest"
},
"devDependencies": {
"@commitlint/cli": "17.1.2",
Expand Down
6 changes: 5 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@

import sade from 'sade'
import pkg from '../package.json' assert { type: 'json' }
import toggle from './toggle'

sade(`${pkg.name.replace(/.*\//, '')} [off|on]`)
.version(pkg.version)
.describe(pkg.description)
.action((): void => void 0)
.example('')
.example('off')
.example('on')
.action((command?: 'off' | 'on'): void => void toggle(command))
.parse(process.argv)

0 comments on commit 508f175

Please sign in to comment.