Skip to content

Commit

Permalink
Update main.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
alla2001 committed Oct 23, 2023
1 parent e697df7 commit f83a3f1
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f83a3f1

Please sign in to comment.