From 6e37b22988e0bf18f8edc318e5b74cb06f7c84ec Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 6 Dec 2022 16:48:30 -0500 Subject: [PATCH] *Do mkdir on just configdir --- src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/index.ts b/src/index.ts index 92976a4..f52c7ce 100644 --- a/src/index.ts +++ b/src/index.ts @@ -173,10 +173,11 @@ export default class Config { assert(typeof data === "object"); assert(!Array.isArray(data)); - const fullPath = Path.join(this.str("configdir"), file); + const configDir = this.str("configdir"); + const fullPath = Path.join(configDir, file); - if (!fs.existsSync(fullPath)) { - fs.mkdirSync(fullPath, { recursive: true }); + if (!fs.existsSync(configDir)) { + fs.mkdirSync(configDir, { recursive: true }); } fs.writeFileSync(fullPath, JSON.stringify(data));