# -*- coding: utf-8 -*-
import shutil

from pkg_resources import resource_filename

from logya.util import paths


def create(dir_site: str, name: str, site: str = None, **kwargs):
    target = paths(dir_site=dir_site).root.joinpath(name)
    if target.exists():
        print(f'Error: "{target}" already exists. Please remove it or specify another location.')
        return
    try:
        source = resource_filename(__name__, f'sites/{site}')
    except KeyError:
        print(f'The site "{site}" is not installed.')
    else:
        shutil.copytree(source, target)
        print(f'Site created in "{target}".')

@@ -32,16 +32,38 @@
 shutil%0A%0A
+from sys import exit%0A%0A
 from pkg
@@ -282,28 +282,27 @@
 ():%0A        
-prin
+exi
 t(f'Error: %22
@@ -379,23 +379,8 @@
 .')%0A
-        return%0A
     
@@ -471,28 +471,27 @@
 or:%0A        
-prin
+exi
 t(f'The site

Call sys.exit on error in create mode.