2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-24 23:48:24 +00:00

Include excluded app in bench update

command bench bench include-app <app-name>
This commit is contained in:
shridhar 2017-12-12 18:15:41 +05:30 committed by Shridhar
parent 708d104bfb
commit bb10b0f94f
3 changed files with 18 additions and 2 deletions

View File

@ -80,6 +80,12 @@ def write_excluded_appstxt(apps, bench_path='.'):
with open(os.path.join(bench_path, 'sites', 'excluded_apps.txt'), 'w') as f:
return f.write('\n'.join(apps))
def remove_from_exclided_appsstxt(app, bench_path='.'):
apps = get_apps(bench_path=bench_path)
if app in apps:
apps.remove(app)
return write_excluded_appstxt(apps, bench_path=bench_path)
def get_app(git_url, branch=None, bench_path='.', build_asset_files=True, verbose=False):
# from bench.utils import check_url
try:

View File

@ -185,3 +185,6 @@ bench_command.add_command(migrate_env)
from bench.commands.exclude_update import exclude_update
bench_command.add_command(exclude_update)
from bench.commands.exclude_update import include_update
bench_command.add_command(include_update)

View File

@ -9,8 +9,7 @@ bench exclude-app <app-name>
import click
from bench.app import add_to_excluded_appstxt
# TODO: Not DRY
from bench.app import remove_from_exclided_appsstxt
@click.command('exclude-app')
@ -19,3 +18,11 @@ def exclude_update(app_name):
"""Update bench"""
add_to_excluded_appstxt(app_name)
return
@click.command('include-app')
@click.argument('app_name')
def include_update(app_name):
"""Update bench"""
remove_from_exclided_appsstxt(app_name)
return