Skip to content

Commit

Permalink
Updated for safer and more common bash script styling
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDuckCow committed Nov 10, 2023
1 parent 88fdcd4 commit e915aa5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions push_latest.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
source venv/bin/activate

RED='\033[0;31m'
Expand Down Expand Up @@ -58,7 +59,7 @@ then
echo ""
else
echo "Commit new updates to mapping file before release:"
echo $ANY_DIFF
echo "$ANY_DIFF"
exit
fi

Expand All @@ -74,24 +75,26 @@ ls build/MCprep_addon.zip

echo ""
echo "Current live tags online:"
echo $(git tag -l)
git tag -l

echo ""
# Extract the numbers between parentheses, replace comma and space with period
BASE_VER=$(grep "\"version\":" MCprep_addon/__init__.py | awk -F"[()]" '{print $2}' | tr ',' '.' | tr -d ' ')
NEW_TAG="${BASE_VER}"
echo -e "Current __init__ version: ${GREEN}${NEW_TAG}${NC}"
read -p "Continue (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
read -p -r "Continue (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
NEW_NAME="MCprep_addon_$NEW_TAG.zip"
mv build/MCprep_addon.zip "build/$NEW_NAME"
exit 0
# Make the tags
echo ""
echo "Generating tags and DRAFT release on github"
# use --generate-notes to auto generate release notes (edit for public changelog)
gh release create $NEW_TAG \
gh release create "$NEW_TAG" \
--draft \
--generate-notes \
-t "v${BASE_VER} | (Update)" \
Expand Down

0 comments on commit e915aa5

Please sign in to comment.