mirror of
https://github.com/frappe/bench.git
synced 2025-02-03 19:38:24 +00:00
skip shopping_cart removal if it doesnt exist
This commit is contained in:
parent
0564872ca4
commit
b551922341
@ -16,14 +16,18 @@ def migrate_to_v5(bench='.'):
|
|||||||
exec_cmd("{bench} update".format(bench=sys.argv[0]))
|
exec_cmd("{bench} update".format(bench=sys.argv[0]))
|
||||||
|
|
||||||
def remove_shopping_cart(bench='.'):
|
def remove_shopping_cart(bench='.'):
|
||||||
|
archived_apps_dir = os.path.join(bench, 'archived_apps')
|
||||||
|
shopping_cart_dir = os.path.join(bench, 'apps', 'shopping_cart')
|
||||||
|
|
||||||
|
if not os.path.exists(shopping_cart_dir):
|
||||||
|
return
|
||||||
|
|
||||||
exec_cmd("{frappe} all --remove_from_installed_apps shopping_cart".format(
|
exec_cmd("{frappe} all --remove_from_installed_apps shopping_cart".format(
|
||||||
frappe=get_frappe(bench=bench)),
|
frappe=get_frappe(bench=bench)),
|
||||||
cwd=os.path.join(bench, 'sites'))
|
cwd=os.path.join(bench, 'sites'))
|
||||||
remove_from_appstxt('shopping_cart', bench=bench)
|
remove_from_appstxt('shopping_cart', bench=bench)
|
||||||
exec_cmd("{pip} --no-input uninstall -y shopping_cart".format(pip=os.path.join(bench, 'env', 'bin', 'pip')))
|
exec_cmd("{pip} --no-input uninstall -y shopping_cart".format(pip=os.path.join(bench, 'env', 'bin', 'pip')))
|
||||||
|
|
||||||
archived_apps_dir = os.path.join(bench, 'archived_apps')
|
|
||||||
shopping_cart_dir = os.path.join(bench, 'apps', 'shopping_cart')
|
|
||||||
if not os.path.exists(archived_apps_dir):
|
if not os.path.exists(archived_apps_dir):
|
||||||
os.mkdir(archived_apps_dir)
|
os.mkdir(archived_apps_dir)
|
||||||
shutil.move(shopping_cart_dir, archived_apps_dir)
|
shutil.move(shopping_cart_dir, archived_apps_dir)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user