diff options
Diffstat (limited to 'buildstream/buildelement.py')
-rwxr-xr-x[-rw-r--r--] | buildstream/buildelement.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/buildstream/buildelement.py b/buildstream/buildelement.py index 35e3c3b02..f6d1df3b0 100644..100755 --- a/buildstream/buildelement.py +++ b/buildstream/buildelement.py @@ -208,3 +208,15 @@ class BuildElement(Element): commands.append(command) return commands + + def generate_script(self): + script = "" + for step in _command_steps: + for prefix in _command_prefixes: + command_name = prefix + step + commands = self.commands[command_name] + + for cmd in commands: + script += "(set -e; {}\n) || exit 1\n".format(cmd) + + return script |