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