gxd-vue-library
Version:
依赖与element Ui插件库,聚福宝福利PC端插件库
44 lines (35 loc) • 1.05 kB
JavaScript
;
const path = require('path');
const clog = require('./../clog');
const utils = require('./../lib/utils');
//oss服务器构建工具(无需确认)
if(process.env.oss) {
clog('\n');
clog(`开始初始化框架`, 'blueBG');
utils.logsLine(clog);
const library = require('./library');
library(() => {
clog(`初始化插件库成功`, 'green');
utils.logsLine(clog);
})
}
//本地构建工具(需要确认构建)
else{
process.stdin['setEncoding']('utf8');
process.stdout['write']("确认执行吗(y/n)?");
process.stdin['on']('data', (input) => {
input = input.toString().trim();
if (['Y', 'y', 'YES', 'yes'].indexOf(input) > -1) {
clog('\n');
clog(`开始初始化框架`, 'blueBG');
utils.logsLine(clog);
const library = require('./library');
library(() => {
clog(`初始化插件库成功`, 'green');
utils.logsLine(clog);
process.exit(0)
})
}
if (['N', 'n', 'NO', 'no'].indexOf(input) > -1) process.exit(0);
});
}