修復檢查文件夾bug

This commit is contained in:
WongXX 2024-05-26 01:57:47 +08:00
parent cf9f7b4608
commit 20d035a5c6

View File

@ -26,7 +26,7 @@ async function main() {
Object.keys(objects).forEach(element => { Object.keys(objects).forEach(element => {
let hash = objects[element].hash; let hash = objects[element].hash;
let distfilepath = join(distpath, element); let distfilepath = join(distpath, element);
if (!distfilepath) { if (!fs.existsSync(distfilepath)) {
fs.mkdirSync(distfilepath, { recursive: true }); fs.mkdirSync(distfilepath, { recursive: true });
} }
fs.renameSync(join(srcpath, hash.substring(0, 2), hash), distfilepath); fs.renameSync(join(srcpath, hash.substring(0, 2), hash), distfilepath);