Try to fix git-get-branch.sh call on Windows
This commit is contained in:
parent
e2ddc03dfe
commit
51031cc1fe
2 changed files with 9 additions and 1 deletions
|
|
@ -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 += \
|
||||
|
|
|
|||
2
scripts/git-get-branch.ps1
Normal file
2
scripts/git-get-branch.ps1
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
$HASH = git log --pretty=%h -1
|
||||
git show-ref | select-string $HASH | select-string -NotMatch HEAD | foreach {$_ -replace '.*/(.*)','$1'}
|
||||
Loading…
Add table
Add a link
Reference in a new issue