From b30b1d3a5201c2a8977c30833fb3080844cbcc6e Mon Sep 17 00:00:00 2001 From: LouisLam Date: Thu, 2 Sep 2021 21:11:20 +0800 Subject: [PATCH] create data dir before copy --- server/server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/server.js b/server/server.js index 42a17679..eb3e508f 100644 --- a/server/server.js +++ b/server/server.js @@ -53,8 +53,8 @@ const sslCert = process.env.SSL_CERT || args["ssl-cert"] || undefined; // Data Directory (must be end with "/") Database.dataDir = process.env.DATA_DIR || args["data-dir"] || "./data/"; Database.path = Database.dataDir + "kuma.db"; -if (! fs.existsSync(this.dataDir)) { - fs.mkdirSync(this.dataDir, { recursive: true }); +if (! fs.existsSync(Database.dataDir)) { + fs.mkdirSync(Database.dataDir, { recursive: true }); } console.log(`Data Dir: ${Database.dataDir}`);