2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 00:37:51 +00:00

Update pull_all_apps to use regex for check (#373)

pull_all_apps calls a "git status" and checks if the response contains "nothing to commit, working directory clean". However, it seems that at least some versions of git output the message "nothing to commit, working directory clean". This causes bench update to not work in systems where the output message uses "tree" instead of "directory". This update is to allow both strings to be used.
This commit is contained in:
ckosiegbu 2017-04-05 07:46:58 +01:00 committed by Rushabh Mehta
parent 893b55991b
commit 4eef5d1b1a

View File

@ -138,7 +138,7 @@ def pull_all_apps(bench_path='.', reset=False):
app_dir = get_repo_dir(app, bench_path=bench_path)
if os.path.exists(os.path.join(app_dir, '.git')):
out = subprocess.check_output(["git", "status"], cwd=app_dir)
if not 'nothing to commit, working directory clean' in out:
if not re.search(r'nothing to commit, working (directory|tree) clean', out):
print '''
Cannot proceed with update: You have local changes in app "{0}" that are not committed.