-
Notifications
You must be signed in to change notification settings - Fork 0
/
.tmplr.yml
104 lines (84 loc) · 2.25 KB
/
.tmplr.yml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
steps:
# remove template files
- remove: package.json
- remove: readme.md
# get project info
- read: project_name
prompt: 'Enter project name:'
default:
from: filesystem.rootdir
- read: project_description
prompt: 'Enter project description:'
- read: install_type
prompt: 'Enter installation type:'
choices:
- 'dev'
- 'global'
- 'dep'
- read: include_dot_vscode
prompt: 'Include .vscode folder?'
choices:
- 'Yes'
- 'No'
- read: include_test_fixtures
prompt: 'Include test fixtures?'
choices:
- 'Yes'
- 'No'
# get computed variables
- read: function_name
eval: '{{ project_name | camelCase }}'
- if:
eval: '{{ install_type | matches: dev }}'
steps:
- read: install_node
eval: 'npm install --save-dev {{ project_name }}'
- read: install_yarn
eval: 'yarn add --dev {{ project_name }}'
- if:
eval: '{{ install_type | matches: global }}'
steps:
- read: install_node
eval: 'npm install --global {{ project_name }}'
- read: install_yarn
eval: 'yarn global add {{ project_name }}'
- if:
eval: '{{ install_type | matches: dep }}'
steps:
- read: install_node
eval: 'npm install {{ project_name }}'
- read: install_yarn
eval: 'yarn add {{ project_name }}'
# setup project
- if:
eval: '{{ include_dot_vscode | matches: No }}'
steps:
- remove: ./template/.vscode
- if:
eval: '{{ include_test_fixtures | matches: Yes }}'
steps:
- copy: ./template/test-fixtures/**/*
to: ./test
include hidden: true
- remove: ./template/test-fixtures
- remove: ./template/test
else:
steps:
- copy: ./template/test/**/*
to: ./test
include hidden: true
- remove: ./template/test
- remove: ./template/test-fixtures
- copy: ./template/**/*
to: ./
include hidden: true
# finish
- remove: ./template/**/*
include hidden: true
# temporarily specify folders to remove (loreanvictor/tmplr#15)
- remove: ./template/.github
- remove: ./template/.vscode
- remove: ./template/src
- remove: ./template/test-d
- remove: ./template
- remove: .tmplr.yml