@echo off REM ============================================================ REM Newbury Exhibit -> Gitea uploader REM Wipe-and-re-clone _deploy checkout, copy tree, commit, push. REM Mirrors the newbury-nights deploy pattern. REM ============================================================ setlocal enabledelayedexpansion set GITEA_HOST=gitea.hideawaygaming.com.au set OWNER=jessikitty set REPO=newbury-exhibit set BRANCH=dev set SRC=%~dp0 echo. echo === Newbury Exhibit deploy === echo Source: %SRC% echo Target: https://%GITEA_HOST%/%OWNER%/%REPO% (branch %BRANCH%) echo. REM --- fresh _deploy checkout --- if exist "%SRC%_deploy" ( echo Removing old _deploy checkout... rmdir /s /q "%SRC%_deploy" ) echo Cloning %BRANCH%... git clone -b %BRANCH% "https://%GITEA_HOST%/%OWNER%/%REPO%.git" "%SRC%_deploy" if errorlevel 1 ( echo ERROR: clone failed. Check credentials / branch exists. pause & exit /b 1 ) REM --- auto-detect git identity from existing global config --- for /f "tokens=*" %%a in ('git config --global user.name') do set GITNAME=%%a for /f "tokens=*" %%a in ('git config --global user.email') do set GITEMAIL=%%a if "!GITNAME!"=="" set GITNAME=jessikitty if "!GITEMAIL!"=="" set GITEMAIL=jess.rogerson.29@outlook.com REM --- copy project files into checkout (exclude deploy/node_modules/git) --- echo Syncing files... robocopy "%SRC%." "%SRC%_deploy" /E /XD "_deploy" "node_modules" ".git" /XF "*.log" >nul pushd "%SRC%_deploy" git config user.name "!GITNAME!" git config user.email "!GITEMAIL!" echo. echo === Staged changes === git add -A git status --short echo. set /p MSG="Commit message (blank = 'Update exhibit'): " if "!MSG!"=="" set MSG=Update exhibit git commit -m "!MSG!" if errorlevel 1 ( echo Nothing to commit, or commit failed. ) else ( git push origin %BRANCH% if errorlevel 1 ( echo ERROR: push failed. & popd & pause & exit /b 1 ) echo. echo === Pushed to %BRANCH% successfully === ) popd pause