-
Notifications
You must be signed in to change notification settings - Fork 28
/
wxapp
33 lines (29 loc) · 824 Bytes
/
wxapp
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
#!/usr/bin/env node
var download = require('download-git-repo');
var ora = require('ora');
var spinner = ora('downloading template')
if(process.argv[2] !== 'init') {
return help();
}
spinner.start();
download('MeCKodo/wxapp',process.argv[3], function (err) {
spinner.stop()
if(err) {
return console.log('error please try again.')
}
console.log()
console.log(' To get started:')
console.log()
console.log(' $ cd ' + process.argv[3])
console.log(' npm install')
console.log(' npm run dev')
console.log()
console.log(' Documentation can be found at https://github.com/MeCKodo/wxapp-cli')
});
function help() {
console.log(' Examples:')
console.log()
console.log(' # create a new project with an lightweight template')
console.log(' $ wxapp init my-project ')
console.log()
}