Skip to content

Commit 51031cc

Browse files
Try to fix git-get-branch.sh call on Windows
1 parent e2ddc03 commit 51031cc

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

OpenRGB.pro

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,13 @@ freebsd:BUILDDATE = $$system(date -j -R -r "${SOURCE_DATE_EPOCH:-$(date +%
7373
macx:BUILDDATE = $$system(date -j -R -r "${SOURCE_DATE_EPOCH:-$(date +%s)}")
7474
GIT_COMMIT_ID = $$system(git log -n 1 --pretty=format:"%H")
7575
GIT_COMMIT_DATE = $$system(git log -n 1 --pretty=format:"%ci")
76-
GIT_BRANCH = $$system(scripts/git-get-branch.sh)
76+
77+
unix {
78+
GIT_BRANCH = $$system(sh scripts/git-get-branch.sh)
79+
}
80+
else {
81+
GIT_BRANCH = $$system(pwsh scripts/git-get-branch.ps1)
82+
}
7783

7884
message("GIT_BRANCH: "$$GIT_BRANCH)
7985
DEFINES += \

scripts/git-get-branch.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$HASH = git log --pretty=%h -1
2+
git show-ref | select-string $HASH | select-string -NotMatch HEAD | foreach {$_ -replace '.*/(.*)','$1'}

0 commit comments

Comments
 (0)