From f83a3f14ce2e0cc9374db52407867a0b9547ee51 Mon Sep 17 00:00:00 2001 From: alla2001 <48186577+alla2001@users.noreply.github.com> Date: Mon, 23 Oct 2023 12:33:26 +0200 Subject: [PATCH] Update main.ts --- src/main/main.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/main.ts b/src/main/main.ts index 55fb11d..dfc5ae9 100644 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -37,9 +37,18 @@ ipcMain.on('ipc-example', async (event, arg) => { const msgTemplate = (pingPong: string) => `IPC test: ${pingPong}`; console.log(msgTemplate(arg)); const currentDirectory = process.cwd(); + let jsonFilePath= ""; + if (app.isPackaged) { + // Code for the production environment + jsonFilePath = path.join(currentDirectory, '/resources/assets/urls.json'); + + } else { + // Code for the development environment + jsonFilePath = path.join(currentDirectory, '/assets/urls.json'); + } // Define the path to your JSON file within the current directory - const jsonFilePath = path.join(currentDirectory, '/assets/urls.json'); + console.log(jsonFilePath); // Read the JSON file