From f5aa819432b37f169fa3650fdfb7aa0dad20fa09 Mon Sep 17 00:00:00 2001 From: Garrett Date: Mon, 18 Sep 2023 11:05:55 -0700 Subject: [PATCH 1/4] Update main.ts --- src/main/main.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/main.ts b/src/main/main.ts index 582090189..af34032f6 100755 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -126,6 +126,7 @@ const pythonIsClosed = (err = globals.python.latestError) => { */ const getPackagedPath = () => { const scriptPath = isWindows ? path.join(__dirname, PY_FLASK_DIST_FOLDER, PYFLASK_BUILD_SUBFOLDER_NAME, `${PYINSTALLER_NAME}.exe`) : path.join(process.resourcesPath, PYFLASK_BUILD_SUBFOLDER_NAME, PYINSTALLER_NAME) + console.warn('Packaged Script Path', scriptPath) if (fs.existsSync(scriptPath)) return scriptPath; }; @@ -134,6 +135,8 @@ const createPyProc = async () => { return new Promise(async (resolve, reject) => { let script = getPackagedPath() || path.join(__dirname, PY_FLASK_FOLDER, "app.py"); + console.warn('Resolved Script Path', script) + await killAllPreviousProcesses(); const defaultPort = PORT as number From 379f0981554ac67955ea97d6f68c787247334ceb Mon Sep 17 00:00:00 2001 From: Garrett Date: Mon, 18 Sep 2023 12:04:40 -0700 Subject: [PATCH 2/4] Remove extra subfolder --- src/main/main.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index af34032f6..508b7016b 100755 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -125,8 +125,7 @@ const pythonIsClosed = (err = globals.python.latestError) => { * @returns {boolean} True if the app is packaged, false if it is running from a dev version. */ const getPackagedPath = () => { - const scriptPath = isWindows ? path.join(__dirname, PY_FLASK_DIST_FOLDER, PYFLASK_BUILD_SUBFOLDER_NAME, `${PYINSTALLER_NAME}.exe`) : path.join(process.resourcesPath, PYFLASK_BUILD_SUBFOLDER_NAME, PYINSTALLER_NAME) - console.warn('Packaged Script Path', scriptPath) + const scriptPath = isWindows ? path.join(__dirname, PY_FLASK_DIST_FOLDER, `${PYINSTALLER_NAME}.exe`) : path.join(process.resourcesPath, PYFLASK_BUILD_SUBFOLDER_NAME, PYINSTALLER_NAME) if (fs.existsSync(scriptPath)) return scriptPath; }; @@ -135,8 +134,6 @@ const createPyProc = async () => { return new Promise(async (resolve, reject) => { let script = getPackagedPath() || path.join(__dirname, PY_FLASK_FOLDER, "app.py"); - console.warn('Resolved Script Path', script) - await killAllPreviousProcesses(); const defaultPort = PORT as number From bbdfe1106b42136e3dc4b319d5ca0848ff39f7d7 Mon Sep 17 00:00:00 2001 From: Garrett Date: Tue, 19 Sep 2023 11:05:41 -0700 Subject: [PATCH 3/4] Re-add logs --- src/main/main.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/main.ts b/src/main/main.ts index 508b7016b..a108cbf66 100755 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -126,6 +126,7 @@ const pythonIsClosed = (err = globals.python.latestError) => { */ const getPackagedPath = () => { const scriptPath = isWindows ? path.join(__dirname, PY_FLASK_DIST_FOLDER, `${PYINSTALLER_NAME}.exe`) : path.join(process.resourcesPath, PYFLASK_BUILD_SUBFOLDER_NAME, PYINSTALLER_NAME) + console.warn('Packaged Script Path', scriptPath) if (fs.existsSync(scriptPath)) return scriptPath; }; @@ -134,6 +135,8 @@ const createPyProc = async () => { return new Promise(async (resolve, reject) => { let script = getPackagedPath() || path.join(__dirname, PY_FLASK_FOLDER, "app.py"); + console.warn('Resolved Script Path', script) + await killAllPreviousProcesses(); const defaultPort = PORT as number From 1e0ca3225f8dbac99a2b62263ed7ce190c52c494 Mon Sep 17 00:00:00 2001 From: Garrett Michael Flynn <46533749+GarrettMFlynn@users.noreply.github.com> Date: Wed, 20 Sep 2023 10:21:11 -0700 Subject: [PATCH 4/4] Update main.ts --- src/main/main.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/main.ts b/src/main/main.ts index a108cbf66..53c027eb2 100755 --- a/src/main/main.ts +++ b/src/main/main.ts @@ -125,8 +125,7 @@ const pythonIsClosed = (err = globals.python.latestError) => { * @returns {boolean} True if the app is packaged, false if it is running from a dev version. */ const getPackagedPath = () => { - const scriptPath = isWindows ? path.join(__dirname, PY_FLASK_DIST_FOLDER, `${PYINSTALLER_NAME}.exe`) : path.join(process.resourcesPath, PYFLASK_BUILD_SUBFOLDER_NAME, PYINSTALLER_NAME) - console.warn('Packaged Script Path', scriptPath) + const scriptPath = isWindows ? path.join(__dirname, PY_FLASK_DIST_FOLDER, PYINSTALLER_NAME, `${PYINSTALLER_NAME}.exe`) : path.join(process.resourcesPath, PYFLASK_BUILD_SUBFOLDER_NAME, PYINSTALLER_NAME) if (fs.existsSync(scriptPath)) return scriptPath; }; @@ -135,8 +134,6 @@ const createPyProc = async () => { return new Promise(async (resolve, reject) => { let script = getPackagedPath() || path.join(__dirname, PY_FLASK_FOLDER, "app.py"); - console.warn('Resolved Script Path', script) - await killAllPreviousProcesses(); const defaultPort = PORT as number