1 | #!/usr/bin/env node
|
2 | const path = require('path')
|
3 | const cac = require('cac')
|
4 | const sao = require('sao')
|
5 | const update = require('update-notifier')
|
6 | const pkg = require('./package')
|
7 |
|
8 | const cli = cac()
|
9 |
|
10 | cli.command('*', 'Generate a new project', input => {
|
11 | const folderName = input[0] || '.'
|
12 | const targetPath = path.resolve(folderName)
|
13 | console.log(`> Generating project in ${targetPath}`)
|
14 |
|
15 | const templatePath = path.dirname(require.resolve('template-vue/package'))
|
16 |
|
17 | return sao({
|
18 | template: templatePath,
|
19 | targetPath
|
20 | })
|
21 | })
|
22 |
|
23 | cli.parse()
|
24 |
|
25 | update({
|
26 | pkg
|
27 | }).notify()
|