调整SysCfg json的保存文件名

This commit is contained in:
yoimiya-kokomi 2022-04-11 12:21:15 +08:00
parent eda003ee74
commit f34509a72d

View File

@ -4,14 +4,14 @@ import lodash from "lodash";
const _path = process.cwd(); const _path = process.cwd();
const _cfgPath = `${_path}/plugins/miao-plugin/components/`; const _cfgPath = `${_path}/plugins/miao-plugin/components/`;
let cfg = {}; let cfg = {};
console.log(cfg);
if (!fs.existsSync(_cfgPath)) { if (!fs.existsSync(_cfgPath)) {
fs.mkdirSync(_cfgPath); fs.mkdirSync(_cfgPath);
} }
try { try {
if (fs.existsSync(_cfgPath + "cfg.json")) { if (fs.existsSync(_cfgPath + "cfg.json")) {
cfg = JSON.parse(fs.readFileSync(_cfgPath + "miao-plugin.json", "utf8")) || {}; cfg = JSON.parse(fs.readFileSync(_cfgPath + "cfg.json", "utf8")) || {};
} }
} catch (e) { } catch (e) {
// do nth // do nth