cd /home/def/otb_billing || exit 1 set -e NEWVER="v0.5.1" STAMP="$(date '+%Y-%m-%d %H:%M:%S')" ZIPNAME="otb_billing-${NEWVER}.zip" echo "===== git status =====" git status --short || true echo echo "===== update VERSION =====" echo "${NEWVER}" > VERSION echo echo "===== backup README =====" cp README.md "README.md.bak.${NEWVER}" echo echo "===== prepend README entry =====" python3 <<'PY' from pathlib import Path from datetime import datetime p = Path("README.md") old = p.read_text() entry = f"""## {datetime.now().strftime('%Y-%m-%d')} — v0.5.1 - Fixed crypto payment email auto-send path - Fixed payment-received emails to attach the real invoice PDF - Switched helper PDF generation to use the working invoice PDF route - Added explorer link into the payment-received email body - Improved invoice PDF payment section with time, TXID, wallet, and rate display - Cleaned helper error handling back to safe non-debug behavior """ p.write_text(entry + "\n" + old) print("README updated") PY echo echo "===== git add =====" git add . echo echo "===== git commit =====" git commit -m "v0.5.1 - crypto email/pdf fixes and payment layout cleanup" echo echo "===== git push =====" git push echo echo "===== build full zip backup =====" cd /home/def || exit 1 rm -f "${ZIPNAME}" zip -r "${ZIPNAME}" otb_billing >/dev/null echo echo "===== done =====" echo "ZIP: /home/def/${ZIPNAME}"