[gnome-builder] maven: check for directory in CWD usage



commit 81d8345418469670de45f4bb2f01803739534bdb
Author: Christian Hergert <chergert redhat com>
Date:   Tue Feb 5 22:22:29 2019 -0800

    maven: check for directory in CWD usage
    
    It would be nice to avoid IO here, but that can be done in a future
    commit if it becomes problematic.

 src/plugins/maven/maven_plugin.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/maven/maven_plugin.py b/src/plugins/maven/maven_plugin.py
index 0f25878dc..651b7ee96 100755
--- a/src/plugins/maven/maven_plugin.py
+++ b/src/plugins/maven/maven_plugin.py
@@ -116,7 +116,11 @@ class MavenBuildTarget(Ide.Object, Ide.BuildTarget):
 
     def do_get_cwd(self):
         context = self.get_context()
-        return Ide.BuildSystem.from_context(context).project_file.get_path()
+        project_file = Ide.BuildSystem.from_context(context).project_file
+        if project_file.query_file_type(0, None) == Gio.FileType.DIRECTORY:
+            return project_file.get_path()
+        else:
+            return project_file.get_parent().get_path()
 
     def do_get_argv(self):
         """


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