-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
executable file
·34 lines (33 loc) · 1023 Bytes
/
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
#!/usr/bin/env node
/*
* @Author: heishanlaoyao
* @Date: 2020-08-22 01:13:48
* @Last Modified by: heishanlaoyao
* @Last Modified time: 2020-08-25 09:41:38
*/
const {readJson } = require('./lib/fileUtil');
const { executeGeneate} = require('./command/geneateStyleFont');
const {command} = require('./lib/command');
const { initIconfontConfig} = require('./command/initConfig')
const colors = require('colors');
(() => {
try {
let packageJson = require('./package.json')
const commands = [
{
name: 'init',
desc: 'Initialize the configuration file',
callback: initIconfontConfig
},
{
name: "generate",
desc: 'Generate the style sheet from the configuration file',
callback: executeGeneate
}
]
command.init(packageJson.version)
command.main(commands)
} catch (error) {
console.error(colors.red(error))
}
})()