mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-14 18:34:29 -05:00
d38e7d2e70
- Use date of last git commit instead of current date for filename - Added download of Tor installation - Added section Tor to installer
40 lines
622 B
Batchfile
40 lines
622 B
Batchfile
REM Usage:
|
|
REM call get-git-ref.bat Variable [Branch]
|
|
|
|
setlocal
|
|
|
|
set Variable=%~1
|
|
if "%Variable%"=="" (
|
|
echo.
|
|
echo Parameter error
|
|
exit /B 1
|
|
)
|
|
|
|
set Ref=
|
|
|
|
:: Check git executable
|
|
set GitPath=
|
|
call "%~dp0find-in-path.bat" GitPath git.exe
|
|
if "%GitPath%"=="" (
|
|
echo.
|
|
echo Git executable not found in PATH.
|
|
exit /B 1
|
|
)
|
|
|
|
set GitParameter=
|
|
set Branch=%~2
|
|
if "%Branch%"=="" (
|
|
set Branch=HEAD
|
|
set GitParameter=--head
|
|
)
|
|
|
|
for /F "tokens=1*" %%A in ('git show-ref %GitParameter% %Branch%') do (
|
|
if "%%B"=="%Branch%" (
|
|
set Ref=%%A
|
|
)
|
|
)
|
|
|
|
:exit
|
|
endlocal & set %Variable%=%Ref%
|
|
exit /B 0
|