2025-04-16
This commit is contained in:
@@ -1,11 +1,32 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
git add -A
|
|
||||||
COMMIT_MSG=$(gum input --placeholder "Commit message...")
|
COMMIT_MSG=$(gum input --placeholder "Commit message...")
|
||||||
git commit -m "$COMMIT_MSG"
|
if [ -z "$COMMIT_MSG"]; then
|
||||||
BRANCH=$(git name-rev --name-only HEAD)
|
echo "Commit cancelled..."
|
||||||
gum confirm "Push?" && git push origin $BRANCH
|
exit 1
|
||||||
if [ "${!#}" == "-pr" ]; then
|
fi
|
||||||
gh pr create --base beta
|
|
||||||
|
git add -A
|
||||||
|
git commit -m "$COMMIT_MSG"
|
||||||
|
|
||||||
|
BRANCH=$(git name-rev --name-only HEAD)
|
||||||
|
gum confirm "Push?" && git push origin $BRANCH
|
||||||
|
|
||||||
|
CREATE_PR=$(gum confirm "Create PR?")
|
||||||
|
|
||||||
|
if [ "${!#}" == "-pr" && CREATE_PR == 0 ]; then
|
||||||
|
REMOTE_BRANCHES=$(git branch -r | grep -v '\//' | sed 's/origin\///')
|
||||||
|
|
||||||
|
if echo "$remote_branches" | grep -q "^beta$"; then
|
||||||
|
PR_BASE="beta"
|
||||||
|
elif echo "$remote_branches" | grep -q "^main$"; then
|
||||||
|
PR_BASE="main"
|
||||||
|
elif echo "$remote_branches" | grep -q "^master$"; then
|
||||||
|
PR_BASE="master"
|
||||||
|
else
|
||||||
|
PR_BASE=$(REMOTE_BRANCHES | gum choose --limit 1 )
|
||||||
|
fi
|
||||||
|
|
||||||
|
gh pr create --base PR_BASE
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user