2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-13 16:56:33 +00:00

fix: Don't break update if no sites exist on patching sites stage

This commit is contained in:
Gavin D'souza 2021-04-23 10:47:36 +05:30
parent 4b31ac078b
commit 778fe6cb0b

View File

@ -356,10 +356,11 @@ def setup_socketio(bench_path='.'):
def patch_sites(bench_path='.'):
try:
run_frappe_cmd('--site', 'all', 'migrate', bench_path=bench_path)
except subprocess.CalledProcessError:
raise PatchError
for site in get_sites(bench_path=bench_path):
try:
migrate_site(site, bench_path=bench_path)
except subprocess.CalledProcessError:
raise PatchError
def build_assets(bench_path='.', app=None):
@ -643,6 +644,10 @@ def update_npm_packages(bench_path='.'):
exec_cmd('npm install', cwd=bench_path)
def migrate_site(site, bench_path='.'):
run_frappe_cmd('--site', site, 'migrate', bench_path=bench_path)
def backup_site(site, bench_path='.'):
run_frappe_cmd('--site', site, 'backup', bench_path=bench_path)