Skip to content

Commit

Permalink
Challenge path works both in dev and in release
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTarados committed Aug 1, 2023
1 parent d28a800 commit 829b3fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { app, BrowserWindow, Menu} = require('electron');
const fs = require('fs');
const path = require('path');
const remoteMain = require('@electron/remote/main');
const ff = require('node-find-folder');
remoteMain.initialize();
const createWindow = () => {
// Create the browser window.
Expand All @@ -25,7 +26,8 @@ const createWindow = () => {
mainWindow.loadFile('index.html')

chal_submenu = [];
fs.readdirSync('./challenges').forEach(file => {
var ff_result = new ff('challenges');
fs.readdirSync(ff_result[0]).forEach(file => {
chal_submenu.push({label: file.split('.')[1], click: () => { mainWindow.webContents.send('Open Challenge', file) }});
});

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@electron/remote": "^2.0.8",
"@fontsource/source-code-pro": "^5.0.1",
"electron-squirrel-startup": "^1.0.0",
"fs": "^0.0.1-security"
"fs": "^0.0.1-security",
"node-find-folder": "^0.1.32"
}
}

0 comments on commit 829b3fd

Please sign in to comment.