diff --git a/index.js b/index.js index 8754137..e907177 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,5 @@ import fs from "fs" -import { join } from "path" +import { join, dirname } from "path" process.stdin.setEncoding("utf8"); @@ -27,7 +27,7 @@ async function main() { let hash = objects[element].hash; let distfilepath = join(distpath, element); if (!fs.existsSync(distfilepath)) { - fs.mkdirSync(distfilepath, { recursive: true }); + fs.mkdirSync(dirname(distfilepath), { recursive: true }); } fs.renameSync(join(srcpath, hash.substring(0, 2), hash), distfilepath); });