chore: pipeline utils 转移到basic

This commit is contained in:
xiaojunnuo
2024-10-08 19:02:51 +08:00
parent 01b79bbeaf
commit 9498d189e4
31 changed files with 301 additions and 104 deletions
@@ -0,0 +1,16 @@
import fs from "fs";
function getFileRootDir(rootDir?: string) {
if (rootDir == null) {
const userHome = process.env.HOME || process.env.USERPROFILE;
rootDir = userHome + "/.certd/storage/";
}
if (!fs.existsSync(rootDir)) {
fs.mkdirSync(rootDir, { recursive: true });
}
return rootDir;
}
export const fileUtils = {
getFileRootDir,
};