diff options
Diffstat (limited to 'lib/gui')
| -rw-r--r-- | lib/gui/electron.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/gui/electron.py b/lib/gui/electron.py index 6a31abe1..4ecc37bf 100644 --- a/lib/gui/electron.py +++ b/lib/gui/electron.py @@ -1,3 +1,4 @@ +from glob import glob import os import subprocess import sys @@ -16,13 +17,12 @@ def open_url(url): else: # It's a bit trickier to find the electron app in a development environment. base_dir = get_bundled_dir("electron") + package_dir = glob(os.path.join(base_dir, 'dist', '*-unpacked')) - try: - package_dir = os.listdir(os.path.join(base_dir, "out"))[0] - except (OSError, IndexError): - raise Exception("Electron app not found. Be sure to run 'npm install; npm run package' in %s." % base_dir) + if not package_dir: + raise Exception("Electron app not found. Be sure to run 'yarn; yarn dist' in %s." % base_dir) - electron_path = os.path.join(base_dir, "out", package_dir, "inkstitch-gui") + electron_path = os.path.join(base_dir, package_dir, "inkstitch-gui") if sys.platform == "darwin": electron_path += ".app/Contents/MacOS/inkstitch-gui" |
