UNPKG

576 BJavaScriptView Raw
1#!/usr/bin/env node
2const path = require('path')
3const cac = require('cac')
4const sao = require('sao')
5const update = require('update-notifier')
6const pkg = require('./package')
7
8const cli = cac()
9
10cli.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
23cli.parse()
24
25update({
26 pkg
27}).notify()