From ea41d2014d50d915f72334eb9d0f9d43b035cca6 Mon Sep 17 00:00:00 2001 From: liangmiQwQ Date: Sat, 15 Nov 2025 18:47:54 +0800 Subject: [PATCH 1/3] chore: --- src/cli/parse-args.ts | 14 +++++++++++--- src/config.ts | 3 +++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/cli/parse-args.ts b/src/cli/parse-args.ts index 05fdd6d..81d5df9 100644 --- a/src/cli/parse-args.ts +++ b/src/cli/parse-args.ts @@ -37,8 +37,8 @@ export async function parseArgs(): Promise { push: args.push, all: args.all, noGitCheck: args.noGitCheck, - confirm: !args.yes, - noVerify: !args.verify, + confirm: args.yes === undefined ? undefined : !args.yes, + noVerify: args.verify === undefined ? undefined : !args.verify, install: args.install, files: [...(args['--'] || []), ...resultArgs], ignoreScripts: args.ignoreScripts, @@ -102,18 +102,26 @@ 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? 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 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 { tag, commit, ...rest } = args + const { tag, commit, yes, ...rest } = args + console.log(args) return { args: { ...rest, commit: hasCommitFlag ? commit : undefined, tag: hasTagFlag ? tag : undefined, + yes: hasYesFlag ? yes : undefined, + // verify: hasNoVerifyFlag ? !no } as { [k: string]: any }, resultArgs: result.args, } diff --git a/src/config.ts b/src/config.ts index 5017f78..ead1efc 100644 --- a/src/config.ts +++ b/src/config.ts @@ -33,6 +33,9 @@ export async function loadBumpConfig( }, cwd: configFile ? dirname(configFile) : cwd, }) + + console.log(config, overrides) + return config! } From cf91ff6595d04ca57628f3d3550f4f02f23ab5d5 Mon Sep 17 00:00:00 2001 From: liangmiQwQ Date: Sat, 15 Nov 2025 18:54:52 +0800 Subject: [PATCH 2/3] chore: update --- src/cli/parse-args.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cli/parse-args.ts b/src/cli/parse-args.ts index 81d5df9..2e9d24b 100644 --- a/src/cli/parse-args.ts +++ b/src/cli/parse-args.ts @@ -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 @@ -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, } From 181ce59577f4a73cb2963d67c89217662ffd002f Mon Sep 17 00:00:00 2001 From: liangmiQwQ Date: Sat, 15 Nov 2025 18:58:19 +0800 Subject: [PATCH 3/3] chore: remove console logs --- src/cli/parse-args.ts | 1 - src/config.ts | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/cli/parse-args.ts b/src/cli/parse-args.ts index 2e9d24b..01304de 100644 --- a/src/cli/parse-args.ts +++ b/src/cli/parse-args.ts @@ -116,7 +116,6 @@ export function loadCliArgs(argv = process.argv) { const { tag, commit, yes, ...rest } = args - console.log(args) return { args: { ...rest, diff --git a/src/config.ts b/src/config.ts index ead1efc..755e6f7 100644 --- a/src/config.ts +++ b/src/config.ts @@ -34,8 +34,6 @@ export async function loadBumpConfig( cwd: configFile ? dirname(configFile) : cwd, }) - console.log(config, overrides) - return config! }