[gnome-builder] plugins/shellcmd: use preferred shell when requested



commit ad07efa95daffecf4c65af92f6927cb790a7cb2c
Author: Christian Hergert <chergert redhat com>
Date:   Tue Sep 27 15:12:30 2022 -0700

    plugins/shellcmd: use preferred shell when requested
    
    Try to use the users preferred shell if it is available in the runtime
    and supports -c.

 src/plugins/shellcmd/gbp-shellcmd-run-command.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/shellcmd/gbp-shellcmd-run-command.c b/src/plugins/shellcmd/gbp-shellcmd-run-command.c
index 719c09902..ec9bc69fd 100644
--- a/src/plugins/shellcmd/gbp-shellcmd-run-command.c
+++ b/src/plugins/shellcmd/gbp-shellcmd-run-command.c
@@ -24,6 +24,8 @@
 
 #include <glib/gi18n.h>
 
+#include "ide-run-context-private.h"
+
 #include "gbp-shellcmd-enums.h"
 #include "gbp-shellcmd-run-command.h"
 
@@ -123,7 +125,13 @@ gbp_shellcmd_run_command_prepare_to_run (IdeRunCommand *run_command,
     }
 
   if (self->use_shell)
-    ide_run_context_push_shell (run_context, FALSE);
+    {
+      if (runtime != NULL &&
+          ide_runtime_contains_program_in_path (runtime, ide_get_user_shell (), NULL))
+        _ide_run_context_push_user_shell (run_context, FALSE);
+      else
+        ide_run_context_push_shell (run_context, FALSE);
+    }
 
   IDE_RUN_COMMAND_CLASS (gbp_shellcmd_run_command_parent_class)->prepare_to_run (run_command, run_context, 
context);
 


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