-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
44 lines (36 loc) · 1.2 KB
/
index.js
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
#!/usr/bin/env node
const chalk = require('chalk')
const semver = require('semver')
const requiredVersion = require('./package.json').engines.node
function checkNodeVersion (wanted, id) {
if (!semver.satisfies(process.version, wanted)) {
console.log(chalk.red(
'You are using Node ' + process.version + ', but this version of ' + id +
' requires Node ' + wanted + '.\nPlease upgrade your Node version.'
))
process.exit(1)
}
}
checkNodeVersion(requiredVersion, 'uniform-cli')
const fs = require('fs');
const path = require('path');
const minimist = require('minimist');
const slash = require('slash');
const program = require('commander');
const loadCommand = require('./lib/util/loadCommand')
program
.version(require('./package.json').version)
.usage('<command> [options]')
program
.command('uni <app-name>')
.description('create a new project powered by vue-cli-service')
.action((name, cmd) => {
const options = cleanArgs(cmd)
// --no-git makes commander to default git to true
if (process.argv.includes('-g') || process.argv.includes('--git')) {
options.forceGit = true
}
function hello() {
return 'nello'
}
})