Skip to content

Commit

Permalink
Make generate.py behave more like cookiecutter
Browse files Browse the repository at this point in the history
Previously, the user was required to give the -n flag for the
extension's name for the command `ckan generate extension`. This moves
the name to prompt and makes the behavior more closesly match just using
`cookiecutter`.
  • Loading branch information
f-osorio committed Oct 9, 2019
1 parent db21000 commit 5d256cf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions ckan/cli/generate.py
Expand Up @@ -13,20 +13,18 @@ def generate():


@generate.command(name=u'extension', short_help=u"Create empty extension.")
@click.option(u'-n', u'--name', help=u"Name of the extension (must begin "
u"with 'ckanext-')",
default=u"extension")
@click.option(u'-o', u'--output-dir', help=u"Location to put the generated "
u"template.",
default=u'.')
def extension(name, output_dir):
def extension(output_dir):
cur_loc = os.path.dirname(os.path.abspath(__file__))
os.chdir(cur_loc)
os.chdir(u'../../contrib/cookiecutter/ckan_extension/')
template_loc = os.getcwd()

# Prompt user for information
click.echo(u"\n")
name = click.prompt(u"Extenion's name", default=u"must begin 'ckanext-'")
author = click.prompt(u"Author's name", default=u"")
email = click.prompt(u"Author's email", default=u"")
github = click.prompt(u"Your Github user or organization name",
Expand Down

0 comments on commit 5d256cf

Please sign in to comment.