Monday, June 17, 2019

In the getlino script we would have a list of “available Lino applications”:

choices = [
  ("noi", "lino_noi.lib.noi.settings", ""),
  ("voga", "lino_voga.lib.voga.settings", ""),
  ("cosi", "lino_cosi.lib.cosi.settings", ""),
  ("avanti", "lino_avanti.lib.avanti.settings", ""),
  ("weleup", "lino_weleup.lib.weleup.settings", ""),
  ("welcht", "lino_voga.lib.voga.settings", ""),
  ("min2", "lino_book.projects.min2.settings", ""),

(min2 would not be useful in practice, but it is an example of an application with a different pattern)

This list cannot be in the cookiecutter config because cc does not know complex choice lists. Actually we don’t use the cc user interface, we allways call it in batch mode.

In the cookiecutter.json file we have three variables instead of the current “appname”:

"app_git_repo": "",
"app_package": "lino_noi",
"app_settings": "lino_noi.lib.noi.settings",

We don need “use_app_dev” anymore.

And then in we replace the following:

{% if cookiecutter.use_app_dev %}
git clone{{ cookiecutter.appname }}.git
pip install -e {{ cookiecutter.appname }}
{% endif %}


{% if cookiecutter.app_git_repo %}
appname=`some bash command to get the last part of repo name`
git clone {{ cookiecutter.app_git_repo }}
pip install -e $appname
{% else %}
pip install {{ cookiecutter.app_package }}
{% endif %}