diff --git a/public/electron.js b/public/electron.js index feead0ee..197ff119 100644 --- a/public/electron.js +++ b/public/electron.js @@ -5,13 +5,40 @@ const child_process = require('child_process'); let flaskProcess; +const path = require('path'); +const fs = require('fs'); + +function searchForAppExe(directory) { + const files = fs.readdirSync(directory); + + for (const file of files) { + const filePath = path.join(directory, file); + const stats = fs.statSync(filePath); + + if (stats.isDirectory()) { + const found = searchForAppExe(filePath); + if (found) { + return found; // Return the filepath if found + } + } else if (file === 'app.exe') { + return filePath; // Return the filepath if it matches 'app.exe' + } + } + + return null; // Return null if 'app.exe' is not found in the directory or its subdirectories +} + // Function to start the Flask process function startFlaskProcess() { try { // Attempt to spawn the process using the original path - let filepath = path.join(__dirname, '..', '..', '..', 'dist', 'app', 'app.exe'); - if (!fs.existsSync(filepath)) { - filepath = path.join(__dirname, '..', 'dist', 'app', 'app.exe'); + const filepath = searchForAppExe(path.join(__dirname, '..', '..', '..')); + + if (filepath) { + console.log("Path to app.exe:", filepath); + } else { + console.error("app.exe file not found!"); + process.exit(21); } flaskProcess = child_process.spawn(filepath); diff --git a/src/pages/about.tsx b/src/pages/about.tsx index ebafcbad..6f52b7fb 100644 --- a/src/pages/about.tsx +++ b/src/pages/about.tsx @@ -7,7 +7,7 @@ export default function About() { name: "Jonas Gabriel", linkedin: "https://www.linkedin.com/in/jonas-gabriel-araujo/", github: "https://github.com/jonasgabriel18", - photo: "../../assets/jonas.jpg", + photo: "../../../assets/jonas.jpg", }, { @@ -22,35 +22,35 @@ export default function About() { name: "Bertrand Lira", linkedin: "https://www.linkedin.com/in/bertrand-lira-veloso-52aa4926a/", github: "https://github.com/BertrandLira", - photo: "../assets/bertrand.jpg", + photo: "../../../assets/bertrand.jpg", }, { name: "Cameron Maloney", linkedin: "https://www.linkedin.com/in/cameronmal/", github: "https://github.com/cmaloney111", - photo: "assets/cameron.jpg", + photo: "../../../assets/cameron.jpg", }, { name: "Gisele Silva", linkedin: "https://www.linkedin.com/in/gisele-silva-6692941a4/", github: "https://github.com/GiseleBr678", - photo: "../build/assets/LINDADEMAIS/gisele.jpg", + photo: "../../../assets/LINDADEMAIS/gisele.jpg", }, { name: "Thauã Magalhães", linkedin: "https://www.linkedin.com/in/thaua-lucas/", github: "https://github.com/tahaluh", - photo: "../../../../assets/thaua.jpg", + photo: "../../../assets/thaua.jpg", }, { name: "Thiago Rodrigues", linkedin: "https://www.linkedin.com/in/thiago-rodrigues-b8a328249/", github: "https://github.com/tahaluh", - photo: "thiago.jpg", + photo: "../../../assets/thiago.jpg", }, ];