@afuteam-nx/plugin-code-complexity
Version:
对代码仓库执行代码质量的复杂度检查,支持批量项目。
25 lines • 814 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const fs = require("fs");
function writeRes2SomePath(fileName, data, ResDirPath) {
if (!ResDirPath) {
console.error('结果路径没有配置,请检查');
return;
}
// 目标文件夹路径
const dirPath = ResDirPath;
// 确保目标文件夹存在,如果不存在就创建它
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true });
}
// 目标文件完整路径
const filePath = path.join(dirPath, fileName);
// 写入文件
fs.writeFileSync(filePath, JSON.stringify(data, null, 2));
console.log(`结果已写入到 ${filePath}`);
}
exports.default = {
writeRes2SomePath
};
//# sourceMappingURL=index.js.map