Skip to content

Commit 218996c

Browse files
committed
Attempt to fix branch variable
1 parent 9653e00 commit 218996c

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed
Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
@echo off
22

3-
for /f "usebackq tokens=3" %%i in (`findstr PHP_MAJOR_VERSION main\php_version.h`) do set BRANCH=%%i
4-
for /f "usebackq tokens=3" %%i in (`findstr PHP_MINOR_VERSION main\php_version.h`) do set BRANCH=%BRANCH%.%%i
3+
if /i "%APPVEYOR%" equ "True" (
4+
set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
5+
) else (
6+
if "%GITHUB_BASE_REF%" equ "master" (
7+
set IS_MASTER = "True"
8+
)
9+
if "%GITHUB_HEAD_REF%" equ "master" (
10+
set IS_MASTER = "True"
11+
)
12+
if "%IS_MASTER%" equ "True" (
13+
set BRANCH = "master"
14+
) else (
15+
for /f "usebackq tokens=3" %%i in (`findstr PHP_MAJOR_VERSION main\php_version.h`) do set BRANCH=%%i
16+
for /f "usebackq tokens=3" %%i in (`findstr PHP_MINOR_VERSION main\php_version.h`) do set BRANCH=%BRANCH%.%%i
17+
)
18+
)

0 commit comments

Comments
 (0)