UNPKG

applets-helper

Version:

applets-helper 支持市场上主流的小程序,在脱离IDE工具的情况下,通过命令行工具可以快速发布预览和体验版本,同时集成了邮件和企业微信等通知方式,方便持续构建和快速部署(Jenkins/Gilab CI)和通知测试人员跟进测试。

27 lines (22 loc) 816 B
const fs = require('fs-extra'); const path = require('path'); module.exports = (options) => { let {cwdPath, oValue} = options; if (!oValue) { throw Error('配置文件名称不能为空'); } try { const globalConfPath = path.resolve(__filename, '../../config.global.json'); const globalConf = require(globalConfPath); // 查看全局配置信息 if (oValue === 'list') { console.log(globalConf); return; } const initConf = require(path.resolve(cwdPath, `./${oValue}`)); const lastConf = Object.assign({}, globalConf, initConf); fs.writeJSONSync(globalConfPath, lastConf, {spaces: 4}); }catch(e) { console.log('初始化全局配置失败:\n', e); } };