Commit a5bd9ea7 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Add a utility to combine shell commands

Add a function that combines individual shell commands into
a single command (calling the standard shell) that executes
the given commands in sequence while they succeed.
Signed-off-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarPetr Pudlak <>
parent 692ee302
......@@ -239,6 +239,13 @@ def ShellQuoteArgs(args):
return " ".join([ShellQuote(i) for i in args])
def ShellCombineCommands(cmdlist):
"""Out of a list of shell comands construct a single one.
return ["/bin/sh", "-c", " && ".join(ShellQuoteArgs(c) for c in cmdlist)]
class ShellWriter:
"""Helper class to write scripts with indentation.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment