@echo off setlocal set "SRC_ROOT=%~dp0" set "GIT_COMMIT=" for /f "delims=" %%H in ('git -C "%SRC_ROOT%." rev-parse --short^=8 HEAD') do set "GIT_COMMIT=%%H" if not defined GIT_COMMIT ( echo ERROR: Cannot determine the Git commit. Make Git available in PATH. 1>&2 exit /b 1 ) pushd "%SRC_ROOT%Bin" || exit /b 1 hex2000.exe UKSSTMS320F28335.out -boot -sci8 -map UKSSTMS320F28335.map -o UKSSTMS320F28335_%GIT_COMMIT%.bin -b set "BUILD_RESULT=%errorlevel%" popd exit /b %BUILD_RESULT%