[gnome-builder/wip/chergert/headerbar: 29/34] jhbuild: locate jhbuild on wayland sessions



commit cb68b73ca449e864eaf14a148ed28e786ddba086
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jun 21 16:10:33 2016 -0700

    jhbuild: locate jhbuild on wayland sessions

 plugins/jhbuild/jhbuild_plugin.py |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/plugins/jhbuild/jhbuild_plugin.py b/plugins/jhbuild/jhbuild_plugin.py
index 3fc3d5d..3a7483c 100644
--- a/plugins/jhbuild/jhbuild_plugin.py
+++ b/plugins/jhbuild/jhbuild_plugin.py
@@ -34,10 +34,19 @@ class JhbuildRuntime(Ide.Runtime):
     def __init__(self, *args, **kwargs):
         Ide.Runtime.__init__(self, *args, **kwargs)
 
+    def get_jhbuild_path(self):
+        # Wayland session doesn't have ~/.local/
+        path = os.path.expanduser('~/.local/bin/jhbuild')
+        if os.path.exists(path):
+            return path
+        else:
+            # Rely on search path
+            return 'jhbuild'
+
     def do_create_launcher(self):
         try:
             launcher = Ide.Runtime.do_create_launcher(self)
-            launcher.push_argv('jhbuild')
+            launcher.push_argv(self.get_jhbuild_path())
             launcher.push_argv('run')
             return launcher
         except GLib.Error:


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