1 Star 4 Fork 2

吴富其/SimpleEngine-pixijs

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
JsonSnippets.js 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
吴富其 提交于 2021-07-15 10:32 . 1
const fs = require('fs')
const os = require('os');
//解析路径,获取用户名
//写入文件
const writeFile = function(content, distPath) {
fs.writeFileSync(distPath, content)
console.log('写入文件成功:' + distPath);
}
function main() {
const distFilePath = os.homedir() + "/AppData/Roaming/Code/User/snippets/json.json";
let configContentJson;
// var wshshell = new ActiveXObject("wscript.shell");
// var localAppData = wshshell.ExpandEnvironmentStrings("%localappdata%");
console.log('自动配置:', os.homedir())
fs.readFile("./src/avggame/json.json", "utf-8", function(err, data) {
let j = JSON.parse(data);
configContentJson = j;
fs.readFile("./src/huaping/json.json", "utf-8", function(err, data) {
let j = JSON.parse(data);
for (let key in j) {
configContentJson[key] = j[key];
}
writeFile(JSON.stringify(configContentJson, "", "\t"), distFilePath)
console.log('自动配置vscode snippets成功!')
});
});
}
main();
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wu_fuqi/SimpleEngine-pixijs.git
git@gitee.com:wu_fuqi/SimpleEngine-pixijs.git
wu_fuqi
SimpleEngine-pixijs
SimpleEngine-pixijs
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385