2
0
mirror of https://github.com/frappe/bench.git synced 2024-09-24 04:59:01 +00:00

Merge pull request #820 from saurabh6790/validate-branch

fix: validate branch before update
This commit is contained in:
Saurabh 2019-07-22 17:04:16 +05:30 committed by GitHub
commit afb5f532bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -421,3 +421,13 @@ def get_apps_json(path):
else:
with open(path) as f:
return json.load(f)
def validate_branch():
for app in ['frappe', 'erpnext']:
branch = get_current_branch(app)
if branch == "master":
print(''' master branch is renamed to version-11 and develop to version-12. Please switch to new branches to get future updates.
To switch to version 11, run the following commands: bench switch-to-branch version-11''')
sys.exit(1)

View File

@ -1,7 +1,7 @@
import click
import sys, os
from bench.config.common_site_config import get_config, update_config
from bench.app import pull_all_apps, is_version_upgrade
from bench.app import pull_all_apps, is_version_upgrade, validate_branch
from bench.utils import (update_bench, validate_upgrade, pre_upgrade, post_upgrade, before_update,
update_requirements, update_node_packages, backup_all_sites, patch_sites, build_assets,
restart_supervisor_processes, restart_systemd_processes)
@ -48,8 +48,9 @@ def update(pull=False, patch=False, build=False, bench=False, auto=False, restar
print('Release bench, cannot update')
sys.exit(1)
version_upgrade = is_version_upgrade()
validate_branch()
version_upgrade = is_version_upgrade()
if version_upgrade[0]:
print()
print()