mirror of
https://github.com/frappe/bench.git
synced 2025-01-24 23:48:24 +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)
|
apps = get_apps(bench=bench)
|
||||||
if app not in apps:
|
if app not in apps:
|
||||||
apps.append(app)
|
apps.append(app)
|
||||||
with open(os.path.join(bench, 'sites', 'apps.txt'), 'w') as f:
|
return write_appstxt(apps, bench=bench)
|
||||||
return f.write('\n'.join(apps))
|
|
||||||
|
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='.'):
|
def get_app(app, git_url, branch=None, bench='.'):
|
||||||
logger.info('getting app {}'.format(app))
|
logger.info('getting app {}'.format(app))
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
from .utils import exec_cmd, get_frappe
|
from .utils import exec_cmd, get_frappe
|
||||||
|
from .release import get_current_version
|
||||||
|
from .app import remove_from_appstxt
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
from .release import get_current_version
|
|
||||||
|
|
||||||
repos = ('frappe', 'erpnext')
|
repos = ('frappe', 'erpnext')
|
||||||
|
|
||||||
@ -20,7 +21,11 @@ def migrate_to_v5(bench='.'):
|
|||||||
|
|
||||||
def remove_shopping_cart(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("{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')
|
archived_apps_dir = os.path.join(bench, 'archived_apps')
|
||||||
shopping_cart_dir = os.path.join(bench, 'apps', 'shopping_cart')
|
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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user