1 | #!/usr/bin/env node
|
2 |
|
3 | const program = require('commander')
|
4 | const fs = require('fs')
|
5 | const path = require('path')
|
6 | const chalk = require('chalk')
|
7 |
|
8 | const test = require('../.cyb/test')
|
9 |
|
10 | const checkFezConfigFile = fs.existsSync(path.join(process.cwd(), './fez.config.js'))
|
11 | const checkCybConfigFile = fs.existsSync(path.join(process.cwd(), './cyb.config.js'))
|
12 |
|
13 | if (checkFezConfigFile || checkCybConfigFile) {
|
14 | program
|
15 | .description('本地测试dist目录')
|
16 | .parse(process.argv)
|
17 |
|
18 | test()
|
19 | } else {
|
20 | console.log(chalk.red('请在项目根目录下执行 test 命令'))
|
21 | }
|