mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 18:45:09 +00:00
Try and make branch non-derpy
This commit is contained in:
1 parent
d3c0e1f589
commit
7a8dae5e35
1 file changed
+9
-1
+9
-1
@@ -48,9 +48,17 @@ def main():
|
|||||||
(mcpversion,mcclientversion,mcserverversion) = re.match("[.\w]+ \(data: ([.\w]+), client: ([.\w.]+), server: ([.\w.]+)\)",Commands.fullversion()).groups()
|
(mcpversion,mcclientversion,mcserverversion) = re.match("[.\w]+ \(data: ([.\w]+), client: ([.\w.]+), server: ([.\w.]+)\)",Commands.fullversion()).groups()
|
||||||
|
|
||||||
if os.getenv("GIT_BRANCH") is None:
|
if os.getenv("GIT_BRANCH") is None:
|
||||||
branch="master"
|
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="master"
|
||||||
else:
|
else:
|
||||||
branch=os.getenv("GIT_BRANCH").rpartition('/')[2]
|
branch=os.getenv("GIT_BRANCH").rpartition('/')[2]
|
||||||
|
if branch == 'HEAD':
|
||||||
|
branch = "master"
|
||||||
|
|
||||||
with open("fmlversion.properties","w") as f:
|
with open("fmlversion.properties","w") as f:
|
||||||
f.write("%s=%s\n" %("fmlbuild.major.number",major))
|
f.write("%s=%s\n" %("fmlbuild.major.number",major))
|
||||||
|
|||||||
Reference in new issue
Block a user