Skip to content

Commit

Permalink
Fixed path error in rmg.main.getGetCommit
Browse files Browse the repository at this point in the history
Closes #93
  • Loading branch information
sean-v8 committed Jul 26, 2012
1 parent c0f7e97 commit d3162b0
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions rmgpy/rmg/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,15 +482,13 @@ def finish(self):
logging.info('RMG execution terminated at ' + time.asctime())

def getGitCommit(self):
import subprocess
from rmgpy import getPath
try:
f = os.popen('git log --format="%H %n %cd" -1')
lines = []
for line in f: lines.append(line)
f.close()
head = lines[0].strip()
date = lines[1].strip()
return head, date
except IndexError:
return subprocess.check_output(['git', 'log',
'--format=%H%n%cd', '-1'],
cwd=getPath()).splitlines()
except:
return '', ''

def logHeader(self, level=logging.INFO):
Expand Down

0 comments on commit d3162b0

Please sign in to comment.