From cf6007b63d2bf712b3be9819639d6ec303e2ec91 Mon Sep 17 00:00:00 2001 From: Abdallah Magdy Date: Sat, 23 Dec 2023 11:23:36 +0200 Subject: [PATCH] Fix Issue #50 - Create a new file not a new directory --- src/utils/fileUtils.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/fileUtils.ts b/src/utils/fileUtils.ts index 7b08ad0..bb01e89 100644 --- a/src/utils/fileUtils.ts +++ b/src/utils/fileUtils.ts @@ -1,6 +1,6 @@ import * as fs from "node:fs" -export function createIfNot(dir:string) { - if (!fs.existsSync(dir)) { - fs.mkdirSync(dir, { recursive: true }) +export function createIfNot(filePath:string) { + if (!fs.existsSync(filePath)) { + fs.writeFileSync(filePath, '', { flag: 'wx' }); } -} +} \ No newline at end of file