Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Search all programfile paths for git bash, to work correctly on 64-bi…

…t windows
  • Loading branch information...
commit 35aa2368c1e1cbc6569730ad68a3e1952cc71621 1 parent a168dfa
Cameron Finucane authored
Showing with 16 additions and 4 deletions.
  1. +16 −4 dist/LTLMoP_GitHub_Setup.py
View
20 dist/LTLMoP_GitHub_Setup.py
@@ -146,11 +146,19 @@ def githubAPICall(path, data=None, method=None):
time.sleep(0.01)
if cmd.returncode != 0:
- bash_path = r'C:\Program Files\Git\bin\bash.exe'
print "Trying to use Git Bash..."
- try:
- cmd = subprocess.Popen([bash_path, "--login", "-i", "-c", 'python "%s"' % (os.path.abspath(__file__))])
- except:
+
+ bash_path = None
+ for ev in ["ProgramFiles", "ProgramFiles(x86)", "ProgramW6432"]:
+ if ev not in os.environ: continue
+
+ bp = os.path.join(os.environ[ev], 'Git', 'bin', 'bash.exe')
+
+ if os.path.exists(bp):
+ bash_path = bp
+ break
+
+ if bash_path is None:
print "Couldn't find Git Bash. Please install Git for Windows."
print "(See http://code.google.com/p/msysgit/)"
print
@@ -158,6 +166,10 @@ def githubAPICall(path, data=None, method=None):
raw_input()
sys.exit(1)
+ print "Found Git Bash at %s" % bash_path
+
+ cmd = subprocess.Popen([bash_path, "--login", "-i", "-c", 'python "%s"' % (os.path.abspath(__file__))])
+
# Wait for subprocess to finish
try:
while cmd.returncode is None:
Please sign in to comment.
Something went wrong with that request. Please try again.