Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
chore: fix hotfix script
Kyle Mendell221bb94f9f7d
diff --git a/Justfile b/Justfileindex 5e5f65cf7..875a5fb42 100644--- a/Justfile+++ b/Justfile@@ -323,6 +323,18 @@ _utils-hotfix:git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname --merged "$ref" | head -n1}+ cherry_pick_in_progress() {+ git rev-parse -q --verify CHERRY_PICK_HEAD >/dev/null 2>&1+ }++ has_unmerged_conflicts() {+ [ -n "$(git diff --name-only --diff-filter=U)" ]+ }++ working_tree_dirty() {+ [ -n "$(git status --porcelain)" ]+ }+LATEST_TAG=$(get_latest_repo_tag "main")if [ -z "$LATEST_TAG" ]; thenLATEST_TAG=$(get_latest_repo_tag "HEAD")@@ -420,10 +432,21 @@ _utils-hotfix:case "$INPUT" indone)+ if cherry_pick_in_progress || has_unmerged_conflicts; then+ echo -e "${RED}A cherry-pick is still in progress.${NC}"+ echo -e "Run ${YELLOW}git add <resolved-files>${NC} and ${YELLOW}git cherry-pick --continue${NC} first,"+ echo -e "or run ${YELLOW}git cherry-pick --abort${NC} to discard it."+ continue+ fibreak;;quit)echo -e "${YELLOW}Aborting hotfix release...${NC}"+ if cherry_pick_in_progress || has_unmerged_conflicts || working_tree_dirty; then+ echo -e "${YELLOW}Working tree is not clean; staying on ${RELEASE_BRANCH}.${NC}"+ echo -e "Resolve the cherry-pick manually with ${GREEN}git cherry-pick --continue${NC} or ${GREEN}git cherry-pick --abort${NC}."+ exit 1+ figit checkout mainread -p "Delete release branch ${RELEASE_BRANCH}? (y/n) " DELETE_BRANCHif [[ "$DELETE_BRANCH" == "y" ]]; then@@ -453,6 +476,9 @@ _utils-hotfix:if [[ "$RESOLVE" == "abort" ]]; thengit cherry-pick --abortecho -e "${YELLOW}Cherry-pick aborted${NC}"+ elif cherry_pick_in_progress || has_unmerged_conflicts; then+ echo -e "${YELLOW}Cherry-pick is still in progress.${NC}"+ echo -e "Run ${GREEN}git add <resolved-files>${NC} and ${GREEN}git cherry-pick --continue${NC}, then choose another action."fifi;;@@ -468,6 +494,11 @@ _utils-hotfix:if [ "$COMMITS_ADDED" -eq 0 ]; thenecho -e "${RED}No commits were cherry-picked. Aborting hotfix release.${NC}"+ if cherry_pick_in_progress || has_unmerged_conflicts || working_tree_dirty; then+ echo -e "${YELLOW}Working tree is not clean; staying on ${RELEASE_BRANCH}.${NC}"+ echo -e "Resolve the cherry-pick manually with ${GREEN}git cherry-pick --continue${NC} or ${GREEN}git cherry-pick --abort${NC}."+ exit 1+ figit checkout maingit branch -D "${RELEASE_BRANCH}" 2>/dev/null || trueexit 0