Skip to content

Commit

Permalink
feat: support --no-manager-cache flag
Browse files Browse the repository at this point in the history
close #244
  • Loading branch information
farnabaz committed Nov 5, 2021
1 parent e620635 commit 90d245c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ function _run () {
'--host': String,
'-h': '--host',
'--force': Boolean,
'--tsconfig': String
'--tsconfig': String,
'--no-manager-cache': Boolean
})
const { _, ...flags } = args

Expand Down
3 changes: 2 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ export function requireMaybeEdge (pkg) {
export function normalizeFlags (flags) {
return Object.keys(flags).reduce((acc, flag) => {
const normalizedFlag = flag
.replace(/^--no-/, '')
.replace('--', '')
.replace(/-([a-z])/, v => v.replace('-', '').toUpperCase())
acc[normalizedFlag] = flags[flag]
acc[normalizedFlag] = flag.startsWith('--no-') ? !flags[flag] : flags[flag]
return acc
}, {})
}
Expand Down

0 comments on commit 90d245c

Please # to comment.