Skip to content

Commit

Permalink
find the index of the checkout branch parameter in cookiecutter by us…
Browse files Browse the repository at this point in the history
…ing its parameter name rather than a fixed index
  • Loading branch information
chrisjkuch committed Jan 3, 2025
1 parent c79d820 commit 2ea3c9a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ccds/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ def _main(*args, **kwargs):
f.params[1].default = (
"https://github.com/drivendataorg/cookiecutter-data-science"
)
# The fifth parameter is the "checkout" option in the cookiecutter cli
# Find the "checkout" option in the cookiecutter cli (currently the fifth)
# Per #389, set this to the currently released version by default
f.params[4].default = __version__
param_names = [p.name for p in f.params]
checkout_index = param_names.index("checkout")
f.params[checkout_index].default = __version__
return f(*args, **kwargs)

return _main
Expand Down

0 comments on commit 2ea3c9a

Please sign in to comment.