-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.coffee
50 lines (48 loc) · 1.08 KB
/
init.coffee
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
exports.configure = [
{
name: 'name'
message: "Your project's name"
},
{
name: 'description'
message: "A brief description of your project"
},
{
type: 'confirm'
name: 'netlify'
message: 'Do you need netlify hosting?'
},
{
type: 'confirm'
name: 'grid'
message: 'Do you require a grid framework?'
},
{
type: 'checkbox'
name: 'postcssPlugins'
message: 'Check all Postcss plugins you wish to install.'
choices: [
'rucksack'
'cssnext'
'system'
'postcss font pack'
'postcss import'
]
},
{
type: 'confirm'
name: 'yaml'
message: 'Do you require roots yaml integration?'
}
]
# restructure json objects in array for later convience
exports.beforeRender = (utils, config) ->
@tmp = []
for plugin in config.postcssPlugins
@tmp[plugin.name] = { 'checked': plugin.checked }
config.postcssPlugins = @tmp
exports.after = (utils, config) ->
if config.netlify
utils.target.exec('npm install')
.then -> utils.target.exec('./node_modules/.bin/netlify init')
.catch console.error