mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 08:17:35 +00:00
Try and get a valid branch name on jenkins
This commit is contained in:
1 parent
39a146f8e6
commit
25f1ddac30
1 file changed
+10
-7
+10
-7
@@ -47,13 +47,16 @@ def main():
|
||||
|
||||
(mcpversion,mcclientversion,mcserverversion) = re.match("[.\w]+ \(data: ([.\w]+), client: ([.\w.]+), server: ([.\w.]+)\)",Commands.fullversion()).groups()
|
||||
|
||||
cmd = "git rev-parse --abbrev-ref HEAD"
|
||||
try:
|
||||
process = subprocess.Popen(cmdsplit(cmd), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=-1)
|
||||
branch, _ = process.communicate()
|
||||
except OSError:
|
||||
print("Git not found")
|
||||
branch="none"
|
||||
if os.getenv("GIT_BRANCH") is None:
|
||||
cmd = "git rev-parse --abbrev-ref HEAD"
|
||||
try:
|
||||
process = subprocess.Popen(cmdsplit(cmd), stdout=subprocess.PIPE, stderr=subprocess.STDOUT, bufsize=-1)
|
||||
branch, _ = process.communicate()
|
||||
except OSError:
|
||||
print("Git not found")
|
||||
branch="none"
|
||||
else:
|
||||
branch=os.getenv("GIT_BRANCH")
|
||||
|
||||
with open("fmlversion.properties","w") as f:
|
||||
f.write("%s=%s\n" %("fmlbuild.major.number",major))
|
||||
|
||||
Reference in new issue
Block a user