mirror of
https://github.com/venthur/blag.git
synced 2025-11-25 20:52:43 +00:00
@@ -37,20 +37,25 @@ def get_input(question: str, default: str) -> str:
|
||||
return reply
|
||||
|
||||
|
||||
def copy_templates() -> None:
|
||||
"""Copy templates into current directory.
|
||||
def copy_default_theme() -> None:
|
||||
"""Copy default theme into current directory.
|
||||
|
||||
The default theme contains the 'templates', 'content' and 'static'
|
||||
directories shipped with blag.
|
||||
|
||||
It will not overwrite existing files.
|
||||
|
||||
"""
|
||||
print("Copying templates...")
|
||||
try:
|
||||
shutil.copytree(
|
||||
os.path.join(blag.__path__[0], 'templates'),
|
||||
'templates',
|
||||
)
|
||||
except FileExistsError:
|
||||
print("Templates already exist. Skipping.")
|
||||
print("Copying default theme...")
|
||||
for dir_ in 'templates', 'content', 'static':
|
||||
print(f" Copying {dir_}...")
|
||||
try:
|
||||
shutil.copytree(
|
||||
os.path.join(blag.__path__[0], dir_),
|
||||
dir_,
|
||||
)
|
||||
except FileExistsError:
|
||||
print(f" {dir_} already exist. Skipping.")
|
||||
|
||||
|
||||
def quickstart(args: argparse.Namespace | None) -> None:
|
||||
@@ -92,4 +97,4 @@ def quickstart(args: argparse.Namespace | None) -> None:
|
||||
with open('config.ini', 'w') as fh:
|
||||
config.write(fh)
|
||||
|
||||
copy_templates()
|
||||
copy_default_theme()
|
||||
|
||||
Reference in New Issue
Block a user