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
This commit is contained in:
Mark Pizzolato 2020-06-09 20:07:41 -07:00
parent 3e5bd84523
commit 0912a927f4

View file

@ -99,8 +99,12 @@ cd %~p0
SET GIT_COMMIT_ID= SET GIT_COMMIT_ID=
SET GIT_COMMIT_TIME= SET GIT_COMMIT_TIME=
pushd ..\.. pushd ..\..
git checkout -q master git update-index --refresh -- | findstr update > NUL
git fetch -q origin master 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 git log -1 --pretty="SIM_GIT_COMMIT_ID %%H%%nSIM_GIT_COMMIT_TIME %%aI" >.git-commit-id
popd popd
pushd .. pushd ..
@ -136,7 +140,7 @@ git add README.md
git commit -m "Initializing the Windows Binary repository" git commit -m "Initializing the Windows Binary repository"
git remote add origin "%REMOTE_REPO%" git remote add origin "%REMOTE_REPO%"
git branch -m master %BIN_REPO% git branch -m master %BIN_REPO%
git push -u origin %BIN_REPO% git push --force -u origin %BIN_REPO%
:GitAddNew :GitAddNew
if not exist .git git clone "%REMOTE_REPO%" ./ if not exist .git git clone "%REMOTE_REPO%" ./