소스 검색

Merge pull request #1941 from shreyasp/frappe/force-uninstall-app

[Fix] Added --yes or -y to bypass confirmation prompt to uninstall-app from site
version-14
Rushabh Mehta 9 년 전
committed by GitHub
부모
커밋
ae659a4ad0
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


불러오는 중...
취소
저장