fix(new-site): Pass sql archive as --source-sql
Add --source-sql option as an alias to --source_sql
This commit is contained in:
parent
ebc32a34f6
commit
4ccabc4e21
1 changed files with 5 additions and 2 deletions
|
|
@ -44,7 +44,7 @@ from frappe.exceptions import SiteNotSpecifiedError
|
|||
@click.option(
|
||||
"--force", help="Force restore if site/database already exists", is_flag=True, default=False
|
||||
)
|
||||
@click.option("--source_sql", help="Initiate database with a SQL file")
|
||||
@click.option("--source-sql", "--source_sql", help="Initiate database with a SQL file")
|
||||
@click.option("--install-app", multiple=True, help="Install app after installation")
|
||||
@click.option(
|
||||
"--set-default", is_flag=True, default=False, help="Set the new site as default site"
|
||||
|
|
@ -67,10 +67,13 @@ def new_site(
|
|||
set_default=False,
|
||||
):
|
||||
"Create a new site"
|
||||
from frappe.installer import _new_site
|
||||
from frappe.installer import _new_site, extract_sql_from_archive
|
||||
|
||||
frappe.init(site=site, new_site=True)
|
||||
|
||||
if source_sql:
|
||||
source_sql = extract_sql_from_archive(source_sql)
|
||||
|
||||
_new_site(
|
||||
db_name,
|
||||
site,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue