Try and make branch non-derpy

This commit is contained in:
Christian committed 2012-12-03 23:47:23 -05:00
1 parent d3c0e1f589
commit 7a8dae5e35
1 file changed
+9 -1
+9 -1
View File
@@ -48,9 +48,17 @@ def main():
(mcpversion,mcclientversion,mcserverversion) = re.match("[.\w]+ \(data: ([.\w]+), client: ([.\w.]+), server: ([.\w.]+)\)",Commands.fullversion()).groups()
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:
branch=os.getenv("GIT_BRANCH").rpartition('/')[2]
if branch == 'HEAD':
branch = "master"
with open("fmlversion.properties","w") as f:
f.write("%s=%s\n" %("fmlbuild.major.number",major))