提交 1531795f authored 作者: Glenn Jocher's avatar Glenn Jocher

avoid git status check in Docker bug fix #342

上级 1e9cf6a6
...@@ -45,7 +45,7 @@ def get_latest_run(search_dir='./runs'): ...@@ -45,7 +45,7 @@ def get_latest_run(search_dir='./runs'):
def check_git_status(): def check_git_status():
# Suggest 'git pull' if repo is out of date # Suggest 'git pull' if repo is out of date
if platform in ['linux', 'darwin']: if platform in ['linux', 'darwin'] and not os.path.isfile('/.dockerenv'):
s = subprocess.check_output('if [ -d .git ]; then git fetch && git status -uno; fi', shell=True).decode('utf-8') s = subprocess.check_output('if [ -d .git ]; then git fetch && git status -uno; fi', shell=True).decode('utf-8')
if 'Your branch is behind' in s: if 'Your branch is behind' in s:
print(s[s.find('Your branch is behind'):s.find('\n\n')] + '\n') print(s[s.find('Your branch is behind'):s.find('\n\n')] + '\n')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论