mirror of
https://github.com/frappe/bench.git
synced 2025-02-04 11:58:25 +00:00
Include excluded app in bench update
command bench bench include-app <app-name>
This commit is contained in:
parent
708d104bfb
commit
bb10b0f94f
@ -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:
|
with open(os.path.join(bench_path, 'sites', 'excluded_apps.txt'), 'w') as f:
|
||||||
return f.write('\n'.join(apps))
|
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):
|
def get_app(git_url, branch=None, bench_path='.', build_asset_files=True, verbose=False):
|
||||||
# from bench.utils import check_url
|
# from bench.utils import check_url
|
||||||
try:
|
try:
|
||||||
|
@ -185,3 +185,6 @@ bench_command.add_command(migrate_env)
|
|||||||
|
|
||||||
from bench.commands.exclude_update import exclude_update
|
from bench.commands.exclude_update import exclude_update
|
||||||
bench_command.add_command(exclude_update)
|
bench_command.add_command(exclude_update)
|
||||||
|
|
||||||
|
from bench.commands.exclude_update import include_update
|
||||||
|
bench_command.add_command(include_update)
|
||||||
|
@ -9,8 +9,7 @@ bench exclude-app <app-name>
|
|||||||
|
|
||||||
import click
|
import click
|
||||||
from bench.app import add_to_excluded_appstxt
|
from bench.app import add_to_excluded_appstxt
|
||||||
|
from bench.app import remove_from_exclided_appsstxt
|
||||||
# TODO: Not DRY
|
|
||||||
|
|
||||||
|
|
||||||
@click.command('exclude-app')
|
@click.command('exclude-app')
|
||||||
@ -19,3 +18,11 @@ def exclude_update(app_name):
|
|||||||
"""Update bench"""
|
"""Update bench"""
|
||||||
add_to_excluded_appstxt(app_name)
|
add_to_excluded_appstxt(app_name)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@click.command('include-app')
|
||||||
|
@click.argument('app_name')
|
||||||
|
def include_update(app_name):
|
||||||
|
"""Update bench"""
|
||||||
|
remove_from_exclided_appsstxt(app_name)
|
||||||
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user