Skip to content

Commit

Permalink
fix: Fix index.html file to be the one in the build folder
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertGemmaJr committed Feb 29, 2024
1 parent 34d8042 commit 106d391
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion public/electron/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ log.initialize({ preload: true });
// TODO @brown-ccv #192: Handle data writing to desktop in a utility process?
// TODO @brown-ccv #192: Handle video data writing to desktop in a utility process?
// TODO @brown-ccv #398: Separate log files for each run through?
// TODO @brown-ccv: Use app.getPath('temp') for temporary JSON file

/************ GLOBALS ***********/

Expand Down Expand Up @@ -268,6 +269,9 @@ function createWindow() {
let mainWindow;
let appURL;

console.log(__dirname);
console.log(path.join(__dirname, "index.html"));

if (process.env.ELECTRON_START_URL) {
// Running in development

Expand All @@ -289,7 +293,10 @@ function createWindow() {

// Load app from the local bundle created by the build process
appURL = url.format({
pathname: path.join(__dirname, "index.html"),
// Moves from path of the electron file (/public/electron/main.js) to build folder (build/index.html)
// TODO @brown-ccv: This means we're using the non-built Electron file?
// TODO @brown-ccv: electron-forge should only be packaging the build folder (package.json needs to point to that file?)
pathname: path.join(__dirname, "../../build/index.html"),
protocol: "file:",
slashes: true,
});
Expand Down

0 comments on commit 106d391

Please sign in to comment.