Skip to content
Snippets Groups Projects
Select Git revision
  • 024a140e8d8a1f86ccf16ef3dd93e3bccbe3bd73
  • master default protected
  • next
  • unfuck-icon-mac
  • rr-item-cruncher
  • http-ms-startup-print
  • better-bans
  • http-ms-rules
  • chat-flood-fix
  • prevent-permissions-footgun
  • ms-address-warning
  • uncapped-master
  • uncapped-hud
  • spectator-little-things
  • no-turn-easing-v1
  • master-server-is-a-bad-name
  • findfile-with-threads
  • fix-nocurl
  • spinout-changes
  • itemodds-fallthrough-fix
  • opengl-maybe-uninitialised
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0.4
  • v1.0.3
  • v1.0.2
  • v1.0.1
  • V1.0.0
32 results

comptime.bat

Blame
  • Forked from Kart Krew / Kart-Public
    Source project has a limited visibility.
    comptime.bat 840 B
    @echo off
    set BRA=Unknown
    set REV=illegal
    
    copy nul: /b +%1\comptime.c tmp.$$$ > nul
    move tmp.$$$ %1\comptime.c > nul
    
    if exist .git goto gitrev
    if exist ..\.git goto gitrev
    if exist .svn goto svnrev
    goto filwri
    
    :gitrev
    set GIT=%2
    if "%GIT%"=="" set GIT=git
    for /f "usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s
    for /f "usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s
    set REV=%REV:~0,8%
    goto filwri
    
    :svnrev
    set BRA=Subversion
    for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s
    set REV=r%REV%
    goto filwri
    
    :filwri
    echo // Do not edit!  This file was autogenerated > %1\comptime.h
    echo // by the %0 batch file >> %1\comptime.h
    echo // >> %1\comptime.h
    echo const char* compbranch = "%BRA%"; >> %1\comptime.h
    echo const char* comprevision = "%REV%"; >> %1\comptime.h