mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
scmversion: Add date
This commit is contained in:
parent
71a38adbc7
commit
e3e8e47ffc
|
@ -4,8 +4,9 @@ SET VERSIONFILE="scmversion.cpp"
|
|||
FOR /F "tokens=* USEBACKQ" %%g IN (`git rev-parse HEAD`) do (SET "HASH=%%g")
|
||||
FOR /F "tokens=* USEBACKQ" %%g IN (`git rev-parse --abbrev-ref HEAD`) do (SET "BRANCH=%%g")
|
||||
FOR /F "tokens=* USEBACKQ" %%g IN (`git describe --tags --dirty --exclude latest`) do (SET "TAG=%%g")
|
||||
FOR /F "tokens=* USEBACKQ" %%g IN (`git log -1 --date=iso8601-strict "--format=%%cd"`) do (SET "CDATE=%%g")
|
||||
|
||||
SET SIGNATURELINE=// %HASH% %BRANCH% %TAG%
|
||||
SET SIGNATURELINE=// %HASH% %BRANCH% %TAG% %CDATE%
|
||||
SET /P EXISTINGLINE=< %VERSIONFILE%
|
||||
|
||||
IF "%EXISTINGLINE%"=="%SIGNATURELINE%" (
|
||||
|
@ -19,6 +20,7 @@ ECHO Updating %VERSIONFILE%...
|
|||
ECHO const char* g_scm_hash_str = "%HASH%";
|
||||
ECHO const char* g_scm_branch_str = "%BRANCH%";
|
||||
ECHO const char* g_scm_tag_str = "%TAG%";
|
||||
ECHO const char* g_scm_date_str = "%CDATE%";
|
||||
)>%VERSIONFILE%
|
||||
|
||||
EXIT
|
||||
|
|
|
@ -4,8 +4,9 @@ VERSION_FILE="scmversion.cpp"
|
|||
HASH=$(git rev-parse HEAD)
|
||||
BRANCH=$(git rev-parse --abbrev-ref HEAD | tr -d '\r\n')
|
||||
TAG=$(git describe --tags --dirty --exclude latest | tr -d '\r\n')
|
||||
DATE=$(git log -1 --date=iso8601-strict --format=%cd)
|
||||
|
||||
SIGNATURE_LINE="// ${HASH} ${BRANCH} ${TAG}"
|
||||
SIGNATURE_LINE="// ${HASH} ${BRANCH} ${TAG} ${DATE}"
|
||||
|
||||
if [ -f $VERSION_FILE ]; then
|
||||
EXISTING_LINE=$(head -n1 $VERSION_FILE | tr -d '\n')
|
||||
|
@ -22,6 +23,7 @@ ${SIGNATURE_LINE}
|
|||
const char* g_scm_hash_str = "${HASH}";
|
||||
const char* g_scm_branch_str = "${BRANCH}";
|
||||
const char* g_scm_tag_str = "${TAG}";
|
||||
const char* g_scm_date_str = "${DATE}";
|
||||
|
||||
EOF
|
||||
|
||||
|
|
|
@ -3,4 +3,5 @@
|
|||
extern const char* g_scm_hash_str;
|
||||
extern const char* g_scm_branch_str;
|
||||
extern const char* g_scm_tag_str;
|
||||
extern const char* g_scm_date_str;
|
||||
|
||||
|
|
Loading…
Reference in a new issue