Skip to content

Commit bc08ea0

Browse files
committed
fix(aicommit): reject --no-push with --release
- Add validation to prevent combining --no-push and --release flags - Display descriptive error message explaining the conflict
1 parent dabb2ec commit bc08ea0

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

aicommit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,14 @@ while (( "$#" )); do
353353
shift
354354
done
355355

356+
# ---------- Incompatible flag checks ----------
357+
if $NO_PUSH && $RELEASE_MODE; then
358+
echo -e "${C_RED}${C_BOLD}⛔ Error: --no-push cannot be combined with --release.${C_RESET}"
359+
echo -e "${C_YELLOW}A release must push its commit, tag, and GitHub release to the remote.${C_RESET}"
360+
echo -e "Drop ${C_BOLD}--no-push${C_RESET} to create the release, or drop ${C_BOLD}--release${C_RESET} to commit locally without pushing."
361+
exit 1
362+
fi
363+
356364
# ---------- Repository checks ----------
357365
if ! git rev-parse --is-inside-work-tree &>/dev/null; then
358366
echo "Error: Not inside a git repository."

0 commit comments

Comments
 (0)