diff --git a/frappe/commands/site.py b/frappe/commands/site.py index ae00f521a5..b2707a8e15 100755 --- a/frappe/commands/site.py +++ b/frappe/commands/site.py @@ -285,16 +285,17 @@ def remove_from_installed_apps(context, app): @click.command('uninstall-app') @click.argument('app') +@click.option('--yes', '-y', help='To bypass confirmation prompt for uninstalling the app', is_flag=True, default=False, multiple=True) @click.option('--dry-run', help='List all doctypes that will be deleted', is_flag=True, default=False) @pass_context -def uninstall(context, app, dry_run=False): +def uninstall(context, app, dry_run=False, yes=False): "Remove app and linked modules from site" from frappe.installer import remove_app for site in context.sites: try: frappe.init(site=site) frappe.connect() - remove_app(app, dry_run) + remove_app(app, dry_run, yes) finally: frappe.destroy() diff --git a/frappe/installer.py b/frappe/installer.py index 7e5ce9d870..172a04f325 100755 --- a/frappe/installer.py +++ b/frappe/installer.py @@ -163,10 +163,10 @@ def remove_from_installed_apps(app_name): if frappe.flags.in_install: post_install() -def remove_app(app_name, dry_run=False): +def remove_app(app_name, dry_run=False, yes=False): """Delete app and all linked to the app's module with the app.""" - if not dry_run: + if not dry_run and not yes: confirm = raw_input("All doctypes (including custom), modules related to this app will be deleted. Are you sure you want to continue (y/n) ? ") if confirm!="y": return