[gnome-builder] plugins/waf: also port run command provider



commit c766d2e906e8fd23cc136c486865e5d46ad7fc4e
Author: Christian Hergert <chergert redhat com>
Date:   Thu Sep 15 17:07:14 2022 -0700

    plugins/waf: also port run command provider

 src/plugins/waf/gbp-waf-run-command-provider.c | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/plugins/waf/gbp-waf-run-command-provider.c b/src/plugins/waf/gbp-waf-run-command-provider.c
index a9d6c72a4..b3676fe03 100644
--- a/src/plugins/waf/gbp-waf-run-command-provider.c
+++ b/src/plugins/waf/gbp-waf-run-command-provider.c
@@ -116,6 +116,7 @@ gbp_waf_run_command_provider_list_commands_async (IdeRunCommandProvider *provide
                                                   gpointer               user_data)
 {
   GbpWafRunCommandProvider *self = (GbpWafRunCommandProvider *)provider;
+  g_autoptr(IdeRunContext) run_context = NULL;
   g_autoptr(IdeSubprocessLauncher) launcher  = NULL;
   g_autoptr(IdeSubprocess) subprocess = NULL;
   g_autoptr(IdeTask) task = NULL;
@@ -167,8 +168,16 @@ gbp_waf_run_command_provider_list_commands_async (IdeRunCommandProvider *provide
   else
     python = "python3";
 
-  launcher = ide_pipeline_create_launcher (pipeline, NULL);
-  ide_subprocess_launcher_push_args (launcher, IDE_STRV_INIT (python, waf, "list", "--color=no"));
+  run_context = ide_run_context_new ();
+  ide_pipeline_prepare_run_context (pipeline, run_context);
+  ide_run_context_append_args (run_context, IDE_STRV_INIT (python, waf, "list", "--color=no"));
+
+  if (!(launcher = ide_run_context_end (run_context, &error)))
+    {
+      ide_task_return_error (task, g_steal_pointer (&error));
+      IDE_EXIT;
+    }
+
   /* There appears to be some installations that will write to stderr instead of stdout */
   ide_subprocess_launcher_set_flags (launcher,
                                      (G_SUBPROCESS_FLAGS_STDOUT_PIPE |


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