From 0912a927f47a2cd3d611e835b7b5b08c535df148 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 9 Jun 2020 20:07:41 -0700 Subject: [PATCH] Win32-Development-Binaries: Update BuildAll - Avoid building a published version with uncommitted files in the working directory - Confirm existence of remote named origin and fetch master branch - Add automatic force to push remote Win32-Development-Binaries repo when resetting the binary directory --- .../Win32-Development-Binaries/BuildAll.cmd | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd b/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd index a2176c15..1f7d2944 100644 --- a/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd +++ b/Visual Studio Projects/Win32-Development-Binaries/BuildAll.cmd @@ -99,8 +99,12 @@ cd %~p0 SET GIT_COMMIT_ID= SET GIT_COMMIT_TIME= pushd ..\.. -git checkout -q master -git fetch -q origin master +git update-index --refresh -- | findstr update > NUL +if not ERRORLEVEL 1 echo **** ERROR **** the local repo has uncommitted files & popd & goto :EOF +git remote | findstr origin > NUL +if ERRORLEVEL 1 echo **** ERROR **** missing 'origin' remote in this repo & popd & goto :EOF +git checkout --quiet master +git fetch origin master git log -1 --pretty="SIM_GIT_COMMIT_ID %%H%%nSIM_GIT_COMMIT_TIME %%aI" >.git-commit-id popd pushd .. @@ -136,11 +140,11 @@ git add README.md git commit -m "Initializing the Windows Binary repository" git remote add origin "%REMOTE_REPO%" git branch -m master %BIN_REPO% -git push -u origin %BIN_REPO% +git push --force -u origin %BIN_REPO% :GitAddNew if not exist .git git clone "%REMOTE_REPO%" ./ -git pull +git pull set _BINARIES_ALREADY_BUILT= for /F "usebackq" %%i in (`git log ^| findstr %GIT_COMMIT_ID%`) do set _BINARIES_ALREADY_BUILT=1 if "%_BINARIES_ALREADY_BUILT%" == "" goto DoBuild