update project root,

This commit is contained in:
louiscklaw
2025-04-17 07:51:53 +08:00
parent 256f3ae8e3
commit 7c65222c47
4 changed files with 378 additions and 0 deletions

32
scripts/clean.js Normal file
View File

@@ -0,0 +1,32 @@
const fs = require("fs");
const path = require("path");
function removeZoneIdentifier(dir) {
fs.readdirSync(dir).forEach((file) => {
const filePath = path.join(dir, file);
if (fs.lstatSync(filePath).isDirectory()) {
removeZoneIdentifier(filePath); // 递归处理子目录
} else {
// const newFilePath = filePath.replace(/\.Zone\.Identifier$/, "");
// if (newFilePath !== filePath) {
// console.log(`removing ${filePath}`);
// }
if (filePath.search(/:Zone\.Identifier$/) > -1) {
fs.unlinkSync(filePath); // 删除文件而不是重命名
console.log("removing ", filePath);
}
if (filePath.search(/.bak$/) > -1) {
fs.unlinkSync(filePath); // 删除文件而不是重命名
console.log("removing ", filePath);
}
if (filePath.search(/.del$/) > -1) {
fs.unlinkSync(filePath); // 删除文件而不是重命名
console.log("removing ", filePath);
}
}
});
}
removeZoneIdentifier(process.cwd());
console.log("done");