From 0232de4ae5b7c5bac28ea81dcc5bd01aaebe8e49 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Wed, 27 Dec 2023 10:03:39 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20create=20sessions.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/util/paths.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/util/paths.ts b/core/util/paths.ts index 5c0e225e8..cc1f56424 100644 --- a/core/util/paths.ts +++ b/core/util/paths.ts @@ -27,7 +27,11 @@ export function getSessionFilePath(sessionId: string): string { } export function getSessionsListPath(): string { - return path.join(getSessionsFolderPath(), "sessions.json"); + const filepath = path.join(getSessionsFolderPath(), "sessions.json"); + if (!fs.existsSync(filepath)) { + fs.writeFileSync(filepath, JSON.stringify([])); + } + return filepath; } export function getConfigJsonPath(): string {