Skip to content

Allow removal of unnecessary fields in cookiecutter.json #16

@sloria

Description

@sloria

I removed "version", "year", and "release date" from cookiecutter.json since they aren't really applicable to the template I'm creating. When I run the cookiecutter script, I get the following traceback

Traceback (most recent call last):
  File "/Users/sloria1/Envs/cookiecutter-flask/bin/cookiecutter", line 8, in <module>
    load_entry_point('cookiecutter==0.6.1', 'console_scripts', 'cookiecutter')()
  File "/Users/sloria1/Envs/cookiecutter-flask/lib/python2.7/site-packages/cookiecutter/main.py", line 90, in main
    cookiecutter(args.input_dir)
  File "/Users/sloria1/Envs/cookiecutter-flask/lib/python2.7/site-packages/cookiecutter/main.py", line 49, in cookiecutter
    config_file=config_file
  File "/Users/sloria1/Envs/cookiecutter-flask/lib/python2.7/site-packages/cookiecutter/generate.py", line 41, in generate_context
    obj = json.load(file_handle, object_pairs_hook=OrderedDict)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 290, in load
    **kw)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 351, in loads
    return cls(encoding=encoding, **kw).decode(s)
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/2.7.5/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 381, in raw_decode
    obj, end = self.scan_once(s, idx)
ValueError: Expecting property name: line 8 column 1 (char 202)

When I put those properties back, the script runs fine.

It would be nice if one could remove properties and still run the script, though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis issue/PR relates to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions