(basePath)
| 30 | // This function is used to get the python executable path |
| 31 | // based on the platform. Use this for deployment. |
| 32 | export const getAppPaths = (basePath) => { |
| 33 | let pythonPath, pgadminFile; |
| 34 | switch (platform()) { |
| 35 | case 'win32': |
| 36 | pythonPath = '../../../../../python/python.exe'; |
| 37 | pgadminFile = '../../../../../web/pgAdmin4.py'; |
| 38 | break; |
| 39 | case 'darwin': |
| 40 | pythonPath = '../../../../Frameworks/Python.framework/Versions/Current/bin/python3'; |
| 41 | pgadminFile = '../../../web/pgAdmin4.py'; |
| 42 | break; |
| 43 | case 'linux': |
| 44 | pythonPath = '../../../../../venv/bin/python3'; |
| 45 | pgadminFile = '../../../../../web/pgAdmin4.py'; |
| 46 | if (insideFlatpak()) { |
| 47 | pythonPath = '/usr/bin/python'; |
| 48 | pgadminFile = '/app/pgAdmin4/web/pgAdmin4.py'; |
| 49 | return [pythonPath, pgadminFile]; |
| 50 | } |
| 51 | break; |
| 52 | default: |
| 53 | pgadminFile = '../../../web/pgAdmin4.py'; |
| 54 | if (platform().startsWith('win')) { |
| 55 | pythonPath = '../python/python.exe'; |
| 56 | } else { |
| 57 | pythonPath = '../venv/bin/python3'; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | return [path.join(basePath, pythonPath), path.join(basePath, pgadminFile)]; |
| 62 | }; |
| 63 | |
| 64 | // This function is used to get the [local] app data path |
| 65 | // based on the platform. Use this for logs etc. |
nothing calls this directly
no test coverage detected