import os

def execute(name, branch, overwrite_if_exists=False):
    try:
        from cookiecutter.main import cookiecutter
    except ImportError as exc:
        raise ImportError(
            'You must install "cookiecutter" to use this command.\n\n $ pip install cookiecutter\n'
        ) from exc

    if os.listdir(os.getcwd()) == []:
        overwrite_if_exists = True

    return cookiecutter(
        'https://github.com/python-bonobo/cookiecutter-bonobo.git',
        extra_context={'name': name},
        no_input=True,
        checkout=branch,
        overwrite_if_exists=overwrite_if_exists
    )


def register(parser):
    parser.add_argument('name')
    parser.add_argument('--branch', '-b', default='master')
    return execute

@@ -32,35 +32,8 @@
 anch
-, overwrite_if_exists=False
 ):%0A 
@@ -277,40 +277,154 @@
     
-if os.listdir(os.getcwd()) == %5B%5D
+overwrite_if_exists = False%0A    project_path = os.path.join(os.getcwd(), name)%0A    if os.path.isdir(project_path) and not os.listdir(project_path)
 :%0A  

Check if target directory is empty instead of current directory and remove overwrite_if_exists argument