UNPKG

744 Btext/coffeescriptView Raw
1# Split stack projects have multiple subprojects
2# The projects are configured in `package
3gulp = require 'gulp'
4
5wizard = (done) ->
6 path = require 'path'
7 fs = require 'fs'
8 bootstrap = require './bootstrap'
9 pkg = require '../package'
10
11 console.log "Adding layer to #{pkg.name} stack"
12
13 bootstrap.wizard (err, {name, repo}) ->
14 pkg.stack[name] = {repo}
15
16 pkgJSON = JSON.stringify pkg, null, ' '
17 pkgPath = path.join __dirname, '../package.json'
18
19 fs.writeFileSync pkgPath, pkgJSON
20
21 inquirer.prompt [
22 name: 'more'
23 type: 'confirm'
24 message: "Add another one?"
25 ], ({more}) ->
26 if more
27 wizard done
28 else
29 done()
30
31gulp.task "split:wizard", wizard
32
33module.exports = {wizard}