diff --git a/runtime/src/js/misc.js b/runtime/src/js/misc.js index 2f0661d93..2b537a094 100644 --- a/runtime/src/js/misc.js +++ b/runtime/src/js/misc.js @@ -26,6 +26,10 @@ const createDir = (dirName) => { } }; +const insideFlatpak = () => { + return platform() === 'linux' && fs.existsSync('/.flatpak-info'); +} + // This function is used to get the python executable path // based on the platform. Use this for deployment. const getPythonPath = () => { @@ -37,8 +41,11 @@ const getPythonPath = () => { case 'darwin': pythonPath = '../../Frameworks/Python.framework/Versions/Current/bin/python3'; break; - case 'linux': - pythonPath = '../venv/bin/python3'; + case 'linux': + pythonPath = '../venv/bin/python3'; + if (insideFlatpak()) { + pythonPath = '/usr/bin/python'; + } break; default: if (platform().startsWith('win')) { @@ -451,4 +458,5 @@ module.exports = { setZoomLevelForAllWindows: setZoomLevelForAllWindows, ConfigureStore: ConfigureStore, parseConsoleArgs: parseConsoleArgs, + insideFlatpak: insideFlatpak, }; diff --git a/runtime/src/js/pgadmin.js b/runtime/src/js/pgadmin.js index 174e1780f..fc0dd65e3 100644 --- a/runtime/src/js/pgadmin.js +++ b/runtime/src/js/pgadmin.js @@ -29,6 +29,10 @@ let pythonPath = misc.getPythonPath(); let pgadminFile = '../web/pgAdmin4.py'; let configFile = '../web/config.py'; +if (misc.insideFlatpak()) { + pgadminFile = '/app/pgAdmin4/web/pgAdmin4.py'; +} + // Override the paths above, if a developer needs to if (fs.existsSync('dev_config.json')) { try {