Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: update
  • Loading branch information
liangmiQwQ committed Nov 15, 2025
commit cf91ff6595d04ca57628f3d3550f4f02f23ab5d5
11 changes: 7 additions & 4 deletions src/cli/parse-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,17 @@ export function loadCliArgs(argv = process.argv) {
const rawArgs = cli.rawArgs
const args = result.options

// TODO: To simplify the checks there, should we move the default value declaration to config.ts/bumpConfigDefaults?
// TODO: To simplify the checks here, should we move the default value declaration to config.ts/bumpConfigDefaults?
const COMMIT_REG = /(?:-c|--commit|--no-commit)(?:=.*|$)/
const TAG_REG = /(?:-t|--tag|--no-tag)(?:=.*|$)/
const YES_REG = /(?:-y|--yes)(?:=.*|$)/
// const NO_VERIFY_REG = /--no-verify(?:=.*|$)/
const NO_VERIFY_REG = /--no-verify(?:=.*|$)/
const INSTALL_ARG = /--install(?:=.*|$)/
const hasCommitFlag = rawArgs.some(arg => COMMIT_REG.test(arg))
const hasTagFlag = rawArgs.some(arg => TAG_REG.test(arg))
const hasYesFlag = rawArgs.some(arg => YES_REG.test(arg))
// const hasNoVerifyFlag = rawArgs.some(arg => NO_VERIFY_REG.test(arg))
const hasNoVerifyFlag = rawArgs.some(arg => NO_VERIFY_REG.test(arg))
const hasInstallFlag = rawArgs.some(arg => INSTALL_ARG.test(arg))

const { tag, commit, yes, ...rest } = args

Expand All @@ -121,7 +123,8 @@ export function loadCliArgs(argv = process.argv) {
commit: hasCommitFlag ? commit : undefined,
tag: hasTagFlag ? tag : undefined,
yes: hasYesFlag ? yes : undefined,
// verify: hasNoVerifyFlag ? !no
verify: hasNoVerifyFlag ? !args.verify : undefined,
install: hasInstallFlag ? !args.install : undefined
} as { [k: string]: any },
resultArgs: result.args,
}
Expand Down