ソースを参照

[Fix] Added --yes or -y to bypass confirmation prompt to uninstall-app from site

version-14
shreyas 9年前
コミット
dac00c0fe6
2個のファイルの変更5行の追加4行の削除
  1. +3
    -2
      frappe/commands/site.py
  2. +2
    -2
      frappe/installer.py

+ 3
- 2
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()



+ 2
- 2
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


読み込み中…
キャンセル
保存