Try to fix git-get-branch.sh call on Windows

This commit is contained in:
Adam Honse 2025-01-17 01:13:17 -06:00
parent e2ddc03dfe
commit 51031cc1fe
2 changed files with 9 additions and 1 deletions

View file

@ -73,7 +73,13 @@ freebsd:BUILDDATE = $$system(date -j -R -r "${SOURCE_DATE_EPOCH:-$(date +%
macx:BUILDDATE = $$system(date -j -R -r "${SOURCE_DATE_EPOCH:-$(date +%s)}")
GIT_COMMIT_ID = $$system(git log -n 1 --pretty=format:"%H")
GIT_COMMIT_DATE = $$system(git log -n 1 --pretty=format:"%ci")
GIT_BRANCH = $$system(scripts/git-get-branch.sh)
unix {
GIT_BRANCH = $$system(sh scripts/git-get-branch.sh)
}
else {
GIT_BRANCH = $$system(pwsh scripts/git-get-branch.ps1)
}
message("GIT_BRANCH: "$$GIT_BRANCH)
DEFINES += \

View file

@ -0,0 +1,2 @@
$HASH = git log --pretty=%h -1
git show-ref | select-string $HASH | select-string -NotMatch HEAD | foreach {$_ -replace '.*/(.*)','$1'}