diff --git a/js/main.js b/js/main.js index f77e068..621a1b9 100644 --- a/js/main.js +++ b/js/main.js @@ -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. @@ -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) }}); }); diff --git a/package.json b/package.json index ad18e2c..84a7d78 100644 --- a/package.json +++ b/package.json @@ -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" } }