changeset 62:7f3b5857f569

EnvShellCommand: fix construction of command for ShellCommand parent class
author John W. Eaton <jwe@octave.org>
date Sat, 23 Mar 2024 00:16:26 -0400
parents 10c1848313c6
children f4ff3fa0e556
files master.cfg
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/master.cfg	Fri Mar 22 16:20:13 2024 -0400
+++ b/master.cfg	Sat Mar 23 00:16:26 2024 -0400
@@ -269,9 +269,12 @@
 
 class EnvShellCommand (ShellCommand):
   def __init__ (self, command = '', **kwargs):
-    kwargs['command'] = [
-      'bash', '-c', 'if [ -f "$HOME/buildbot-worker-env" ]; then source "$HOME/buildbot-worker-env"; else echo "$HOME/buildbot-worker-env not found"; fi; %s' % command
-    ]
+    shell_cmd = 'if [ -f "$HOME/buildbot-worker-env" ]; then source "$HOME/buildbot-worker-env"; else echo "$HOME/buildbot-worker-env not found"; fi; '
+    if isinstance (command, list):
+      shell_cmd += ' '.join (command)
+    else:
+      shell_cmd += command
+    kwargs['command'] = ['bash', '-c', shell_cmd]
     ShellCommand.__init__ (self, **kwargs)
 
 ## Steps we may use in more than one build factory.