fix create
This commit is contained in:
6
run.py
6
run.py
@@ -541,7 +541,7 @@ def register(location: str):
|
|||||||
@click.option(
|
@click.option(
|
||||||
"--force", "-f", is_flag=True, help="Overwrite existing file if it already exists"
|
"--force", "-f", is_flag=True, help="Overwrite existing file if it already exists"
|
||||||
)
|
)
|
||||||
def create(target: str, completed: bool, template: bool, force: bool):
|
def create(target: str, completed: bool, no_template: bool, force: bool):
|
||||||
"""
|
"""
|
||||||
지정된 location을 storage에 생성하는 명령어
|
지정된 location을 storage에 생성하는 명령어
|
||||||
"""
|
"""
|
||||||
@@ -563,10 +563,10 @@ def create(target: str, completed: bool, template: bool, force: bool):
|
|||||||
if not force:
|
if not force:
|
||||||
return
|
return
|
||||||
|
|
||||||
if not template:
|
if no_template:
|
||||||
content = b""
|
content = b""
|
||||||
else:
|
else:
|
||||||
template_path = TEMPLATES_DIR / f"{lang.value}.txt"
|
template_path = TEMPLATES_DIR / f"template.{lang.value}"
|
||||||
if template_path.is_file():
|
if template_path.is_file():
|
||||||
content = template_path.read_bytes()
|
content = template_path.read_bytes()
|
||||||
click.secho(f"Using template: {template_path}", fg="cyan")
|
click.secho(f"Using template: {template_path}", fg="cyan")
|
||||||
|
|||||||
Reference in New Issue
Block a user