Skip to content

Commit b07b2fe

Browse files
committed
Enhance release scripts to include --yes option for skipping confirmation prompts.
1 parent 61adc6b commit b07b2fe

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

scripts/release-wizard.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,9 @@ def create_release(version_spec: str) -> bool:
553553

554554
# 运行发布脚本
555555
if version_spec in ["patch", "minor", "major"]:
556-
cmd = ["python", "scripts/release.py", version_spec]
556+
cmd = ["python", "scripts/release.py", version_spec, "--yes"]
557557
else:
558-
cmd = ["python", "scripts/release.py", "patch", "--version", version_spec]
558+
cmd = ["python", "scripts/release.py", "patch", "--version", version_spec, "--yes"]
559559

560560
print_info("正在创建发布...")
561561
success, output = run_command(cmd)

scripts/release.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def main():
129129
parser.add_argument("bump_type", choices=["patch", "minor", "major"], help="Type of version bump")
130130
parser.add_argument("--version", help="Specific version to set (overrides bump_type)")
131131
parser.add_argument("--dry-run", action="store_true", help="Show what would be done without making changes")
132+
parser.add_argument("--yes", "-y", action="store_true", help="Skip confirmation prompt")
132133

133134
args = parser.parse_args()
134135

@@ -152,10 +153,11 @@ def main():
152153

153154
if not args.dry_run:
154155
# Confirm release
155-
response = input(f"Release version {new_version}? (y/N): ")
156-
if response.lower() != "y":
157-
print("Release cancelled")
158-
sys.exit(0)
156+
if not args.yes:
157+
response = input(f"Release version {new_version}? (y/N): ")
158+
if response.lower() != "y":
159+
print("Release cancelled")
160+
sys.exit(0)
159161

160162
# Update version files
161163
update_version(new_version)

0 commit comments

Comments
 (0)