prevent check_git_status() in docker images (#1951)

* prevent check_git_status() running docker images

* Update general.py
This commit is contained in:
Glenn Jocher 2021-01-16 01:15:38 -08:00 committed by GitHub
parent ca9babb8e6
commit e8a41e8916
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ def check_git_status():
# Recommend 'git pull' if code is out of date
print(colorstr('github: '), end='')
try:
if Path('.git').exists() and check_online():
if Path('.git').exists() and not Path('/.dockerenv').exists() and check_online():
url = subprocess.check_output(
'git fetch && git config --get remote.origin.url', shell=True).decode('utf-8')[:-1]
n = int(subprocess.check_output(