generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpre_gen_project.py
40 lines (36 loc) · 1.02 KB
/
pre_gen_project.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'''
Setting easy to read/maintain cookiecutter variables:
-----------
Web/API Variant
cookiecutter._web_variant
cookiecutter._api_variant
-----------
{% if cookiecutter.variant in ['Web only', 'Both'] %}
{{ cookiecutter.update({ '_web_variant': 'yes' }) }}
{% endif %}
API Variant
{% if cookiecutter.variant in ['API only', 'Both'] %}
{{ cookiecutter.update({ '_api_variant': 'yes' }) }}
{% endif %}
-----------
CSS Addons
cookiecutter._bootstrap_addon
cookiecutter._tailwind_addon
-----------
Only project with web:
{% if cookiecutter._web_variant == 'yes' %}
{% if cookiecutter.css_addon == 'Bootstrap' %}
{{ cookiecutter.update({ '_bootstrap_addon': 'yes' }) }}
{% elif cookiecutter.css_addon == 'Tailwind' %}
{{ cookiecutter.update({ '_tailwind_addon': 'yes' }) }}
{% endif %}
{% endif %}
-----------
Mock Server
cookiecutter.use_mock_server
-----------
Only project with openapi:
{% if cookiecutter._api_variant == 'no' %}
{{ cookiecutter.update({ 'use_mock_server': 'no' }) }}
{% endif %}
'''