From c9ad4adfcc5c114a80d26bc3c7feef0393a8007a Mon Sep 17 00:00:00 2001 From: WongXX Date: Sun, 26 May 2024 02:06:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=BE=A9=E5=89=B5=E5=BB=BA=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=A4=BE=E6=99=82=E9=80=A3=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E5=AD=97=E4=B9=9F=E8=A2=AB=E5=89=B5=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); });