Add update check on start.sh launch

Compares local HEAD against latest main on GitHub and prints a notice
if a newer version is available.
This commit is contained in:
Kacper Kwapisz
2026-03-23 19:35:05 +01:00
parent fef9157c4a
commit 9fe13e5e97
+14
View File
@@ -3,6 +3,20 @@ set -euo pipefail
cd "$(dirname "$0")" cd "$(dirname "$0")"
# Check for updates
REPO="kacperkwapisz/poke-mail"
LOCAL_SHA=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
REMOTE_SHA=$(curl -sf "https://api.github.com/repos/${REPO}/commits/main" \
| grep -m1 '"sha"' | cut -d'"' -f4 || echo "")
if [ -n "$REMOTE_SHA" ] && [ "$REMOTE_SHA" != "$LOCAL_SHA" ]; then
echo "⚡ A newer version of poke-mail is available."
echo " Local: ${LOCAL_SHA:0:7}"
echo " Remote: ${REMOTE_SHA:0:7}"
echo " Run 'git pull' to update."
echo ""
fi
# Load .env if present # Load .env if present
if [ -f .env ]; then if [ -f .env ]; then
set -a set -a