Skip to content

Commit

Permalink
fix: Don't break update if no sites exist on patching sites stage
Browse files Browse the repository at this point in the history
  • Loading branch information
gavindsouza committed Apr 23, 2021
1 parent 4b31ac0 commit 778fe6c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions bench/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 778fe6c

Please sign in to comment.