@echo off
cd /d "%~dp0"

echo.
echo  DashMail ^— Push to Gitea
echo  =========================================
echo.

git status --short
echo.

set /p msg="  Commit message: "

if "%msg%"=="" (
    echo.
    echo  Cancelled -- no message entered.
    echo.
    pause
    exit /b 1
)

echo.
git add -A
git commit -m "%msg%"
git push

echo.
if %errorlevel%==0 (
    echo  Pushed successfully.
) else (
    echo  Push failed -- check your connection to Gitea.
)

echo.
pause
