mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 00:37:51 +00:00
Removed swtich-to-v4 and switch-to-v5 commands
This commit is contained in:
parent
4c30071bcb
commit
c1af9ca4e9
@ -279,12 +279,6 @@ def switch_to_master(apps=None, bench_path='.', upgrade=False):
|
|||||||
def switch_to_develop(apps=None, bench_path='.', upgrade=False):
|
def switch_to_develop(apps=None, bench_path='.', upgrade=False):
|
||||||
switch_branch('develop', apps=apps, bench_path=bench_path, upgrade=upgrade)
|
switch_branch('develop', apps=apps, bench_path=bench_path, upgrade=upgrade)
|
||||||
|
|
||||||
def switch_to_v4(apps=None, bench_path='.', upgrade=False):
|
|
||||||
switch_branch('v4.x.x', apps=apps, bench_path=bench_path, upgrade=upgrade)
|
|
||||||
|
|
||||||
def switch_to_v5(apps=None, bench_path='.', upgrade=False):
|
|
||||||
switch_branch('v5.x.x', apps=apps, bench_path=bench_path, upgrade=upgrade)
|
|
||||||
|
|
||||||
def get_version_from_string(contents, field='__version__'):
|
def get_version_from_string(contents, field='__version__'):
|
||||||
match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % field,
|
match = re.search(r"^(\s*%s\s*=\s*['\\\"])(.+?)(['\"])(?sm)" % field,
|
||||||
contents)
|
contents)
|
||||||
|
@ -29,15 +29,12 @@ bench_command.add_command(remove_app)
|
|||||||
bench_command.add_command(new_site)
|
bench_command.add_command(new_site)
|
||||||
|
|
||||||
|
|
||||||
from bench.commands.update import update, retry_upgrade, switch_to_branch, switch_to_master, switch_to_develop, switch_to_v4, switch_to_v5
|
from bench.commands.update import update, retry_upgrade, switch_to_branch, switch_to_master, switch_to_develop
|
||||||
bench_command.add_command(update)
|
bench_command.add_command(update)
|
||||||
bench_command.add_command(retry_upgrade)
|
bench_command.add_command(retry_upgrade)
|
||||||
bench_command.add_command(switch_to_branch)
|
bench_command.add_command(switch_to_branch)
|
||||||
bench_command.add_command(switch_to_master)
|
bench_command.add_command(switch_to_master)
|
||||||
bench_command.add_command(switch_to_develop)
|
bench_command.add_command(switch_to_develop)
|
||||||
bench_command.add_command(switch_to_v4)
|
|
||||||
bench_command.add_command(switch_to_v5)
|
|
||||||
|
|
||||||
|
|
||||||
from bench.commands.utils import (start, restart, set_nginx_port, set_ssl_certificate, set_ssl_certificate_key, set_url_root,
|
from bench.commands.utils import (start, restart, set_nginx_port, set_ssl_certificate, set_ssl_certificate_key, set_url_root,
|
||||||
set_mariadb_host, set_default_site, download_translations, shell, backup_site, backup_all_sites, release, renew_lets_encrypt,
|
set_mariadb_host, set_default_site, download_translations, shell, backup_site, backup_all_sites, release, renew_lets_encrypt,
|
||||||
|
@ -54,7 +54,7 @@ def update(pull=False, patch=False, build=False, bench=False, auto=False, restar
|
|||||||
print "This update will cause a major version change in Frappe/ERPNext from {0} to {1}.".format(*version_upgrade[1:])
|
print "This update will cause a major version change in Frappe/ERPNext from {0} to {1}.".format(*version_upgrade[1:])
|
||||||
print "This would take significant time to migrate and might break custom apps. Please run `bench update --upgrade` to confirm."
|
print "This would take significant time to migrate and might break custom apps. Please run `bench update --upgrade` to confirm."
|
||||||
print
|
print
|
||||||
print "You can stay on the latest stable release by running `bench switch-to-master` or pin your bench to {0} by running `bench switch-to-v{0}`".format(version_upgrade[1])
|
print "You can stay on the latest stable release by running `bench switch-to-master` or pin your bench to {0}".format(version_upgrade[1])
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
_update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
|
_update(pull, patch, build, bench, auto, restart_supervisor, requirements, no_backup, upgrade, force=force)
|
||||||
@ -145,26 +145,4 @@ def switch_to_develop(upgrade=False):
|
|||||||
switch_to_develop(upgrade=upgrade, apps=['frappe', 'erpnext'])
|
switch_to_develop(upgrade=upgrade, apps=['frappe', 'erpnext'])
|
||||||
print
|
print
|
||||||
print 'Switched to develop'
|
print 'Switched to develop'
|
||||||
print 'Please run `bench update --patch` to be safe from any differences in database schema'
|
print 'Please run `bench update --patch` to be safe from any differences in database schema'
|
||||||
|
|
||||||
|
|
||||||
@click.command('switch-to-v4')
|
|
||||||
@click.option('--upgrade',is_flag=True)
|
|
||||||
def switch_to_v4(upgrade=False):
|
|
||||||
"Switch frappe and erpnext to v4 branch"
|
|
||||||
from bench.app import switch_to_v4
|
|
||||||
switch_to_v4(upgrade=upgrade)
|
|
||||||
print
|
|
||||||
print 'Switched to v4'
|
|
||||||
print 'Please run `bench update --patch` to be safe from any differences in database schema'
|
|
||||||
|
|
||||||
|
|
||||||
@click.command('switch-to-v5')
|
|
||||||
@click.option('--upgrade',is_flag=True)
|
|
||||||
def switch_to_v5(upgrade=False):
|
|
||||||
"Switch frappe and erpnext to v5 branch"
|
|
||||||
from bench.app import switch_to_v5
|
|
||||||
switch_to_v5(upgrade=upgrade)
|
|
||||||
print
|
|
||||||
print 'Switched to v5'
|
|
||||||
print 'Please run `bench update --patch` to be safe from any differences in database schema'
|
|
@ -593,6 +593,13 @@ def update_translations(app, lang):
|
|||||||
f.flush()
|
f.flush()
|
||||||
|
|
||||||
print 'downloaded for', app, lang
|
print 'downloaded for', app, lang
|
||||||
|
|
||||||
|
def download_chart_of_accounts():
|
||||||
|
charts_dir = os.path.join('apps', "erpnext", "erpnext", 'accounts', 'chart_of_accounts', "submitted")
|
||||||
|
csv_file = os.path.join(translations_dir, lang + '.csv')
|
||||||
|
url = "https://translate.erpnext.com/files/{}-{}.csv".format(app, lang)
|
||||||
|
r = requests.get(url, stream=True)
|
||||||
|
r.raise_for_status()
|
||||||
|
|
||||||
def print_output(p):
|
def print_output(p):
|
||||||
while p.poll() is None:
|
while p.poll() is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user