Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(config): allows user to read the cookiecutterrc file from various locations #1483

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

pgierz
Copy link

@pgierz pgierz commented Jan 1, 2021

This allows the cookiecutterrc file to be read from multiple places:

  1. Environ variable ${COOKIECUTTER_USER_CONFIG_PATH}
  2. ${XDG_CONFIG_HOME}/cookiecutter/cookiecutterc
  3. ${XDG_CONFIG_HOME}/cookiecutterrc
  4. ${HOME}/.cookiecutterrc

This allows the program to be more conform with the XDG standard.

Related: See also #1355, which has similar ideas for the cache (cookiecutters and cookiecutter_replay folders)

…s locations

This allows the ``cookiecutterrc`` file to be read from multiple places:

1) Environ variable ``${COOKIECUTTER_USER_CONFIG_PATH}``
2) ``${XDG_CONFIG_HOME}/cookiecutter/cookiecutterc``
3) ``${XDG_CONFIG_HOME}/cookiecutterrc``
4) ``${HOME}/.cookiecutterrc``

This allows the program to be more conform with the XDG standard.

Related: See also cookiecutter#1355, which has similar ideas for the cache
(``cookiecutters`` and ``cookiecutter_replay`` folders)
Copy link
Contributor

@jensens jensens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is useful!

return None


USER_CONFIG_PATH = _find_first_path(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I do not like execution of slightly more complex code on initialization time. This function should be called in merge_configs below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants