[gtk-mac-bundler: 9/12] [Project] Raise an exception if there's an empty launcher tag but the project has no launcher script




commit 70eafa6d0562ce926695acf248b7402264a76919
Author: John Ralls <jralls ceridwen us>
Date:   Mon Jul 18 12:10:10 2022 -0700

    [Project] Raise an exception if there's an empty launcher tag but the project has no launcher script.

 bundler/project.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/bundler/project.py b/bundler/project.py
index 6c564a7..0c7b85e 100644
--- a/bundler/project.py
+++ b/bundler/project.py
@@ -616,9 +616,11 @@ class Project(object):
             path = Path.from_node(node, False)
             if not path.source:
                 # Use the default launcher.
-                launcher = os.path.join(os.path.dirname(__file__),
-                                        "launcher.sh")
-                path = Path(launcher, "${bundle}/Contents/MacOS/${name}")
+                launcher = os.path.join(self.project_path, "launcher.sh")
+                if os.path.exists(launcher):
+                    path = Path(launcher, "${bundle}/Contents/MacOS/${name}")
+                else:
+                    raise Exception("Empty launcher tag but no launcher.sh")
             else:
                 path.dest = "${bundle}/Contents/MacOS/${name}"
             return path


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]