File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,13 @@ def __init__(self, strip_newlines: bool = False):
12
12
13
13
def run (self , commands : Union [str , List [str ]]) -> str :
14
14
"""Run commands and return final output."""
15
- outputs = []
16
15
if isinstance (commands , str ):
17
16
commands = [commands ]
18
- for command in commands :
19
- try :
20
- output = subprocess .check_output (command , shell = True ).decode ()
21
- if self .strip_newlines :
22
- output = output .strip ()
23
- outputs .append (output )
24
- except subprocess .CalledProcessError as error :
25
- return str (error )
26
- return outputs [- 1 ]
17
+ commands = ";" .join (commands )
18
+ try :
19
+ output = subprocess .check_output (commands , shell = True ).decode ()
20
+ except subprocess .CalledProcessError as error :
21
+ return str (error )
22
+ if self .strip_newlines :
23
+ output = output .strip ()
24
+ return output
You can’t perform that action at this time.
0 commit comments