mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 08:30:39 +00:00
remove from appstxt
This commit is contained in:
parent
ffeaa462d1
commit
bbf38c7faf
13
bench/app.py
13
bench/app.py
@ -18,8 +18,17 @@ def add_to_appstxt(app, bench='.'):
|
||||
apps = get_apps(bench=bench)
|
||||
if app not in apps:
|
||||
apps.append(app)
|
||||
with open(os.path.join(bench, 'sites', 'apps.txt'), 'w') as f:
|
||||
return f.write('\n'.join(apps))
|
||||
return write_appstxt(apps, bench=bench)
|
||||
|
||||
def remove_from_appstxt(app, bench='.'):
|
||||
apps = get_apps(bench=bench)
|
||||
if app in apps:
|
||||
apps.remove(app)
|
||||
return write_appstxt(apps, bench=bench)
|
||||
|
||||
def write_appstxt(apps, bench='.'):
|
||||
with open(os.path.join(bench, 'sites', 'apps.txt'), 'w') as f:
|
||||
return f.write('\n'.join(apps))
|
||||
|
||||
def get_app(app, git_url, branch=None, bench='.'):
|
||||
logger.info('getting app {}'.format(app))
|
||||
|
@ -1,7 +1,8 @@
|
||||
from .utils import exec_cmd, get_frappe
|
||||
from .release import get_current_version
|
||||
from .app import remove_from_appstxt
|
||||
import os
|
||||
import shutil
|
||||
from .release import get_current_version
|
||||
|
||||
repos = ('frappe', 'erpnext')
|
||||
|
||||
@ -20,7 +21,11 @@ def migrate_to_v5(bench='.'):
|
||||
|
||||
def remove_shopping_cart(bench='.'):
|
||||
exec_cmd("{pip} --no-input uninstall -y shopping_cart".format(pip=os.path.join(bench, 'env', 'bin', 'pip')))
|
||||
exec_cmd("{frappe} all --remove_from_installed_apps shopping_cart".format(frappe=get_frappe(bench=bench)))
|
||||
exec_cmd("{frappe} all --remove_from_installed_apps shopping_cart".format(
|
||||
frappe=get_frappe(bench=bench)),
|
||||
cwd=os.path.join(bench, 'sites'))
|
||||
remove_from_appstxt('shopping_cart', bench=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(archived_apps_dir):
|
||||
|
Loading…
Reference in New Issue
Block a user