Commit 6b25439b authored by Ximin Luo's avatar Ximin Luo

Remove any existing artifact, in case the build script doesn't overwrite it

parent 529d5821
......@@ -288,12 +288,15 @@ VARIATIONS = types.MappingProxyType(collections.OrderedDict([
def build(script, source_root, dist_root, artifact_pattern, testbed, artifact_store, env):
# TODO: we should probably `rm -f artifact_pattern` in case the
# build script doesn't overwrite like how make(1) sometimes works.
print(source_root)
# testbed.execute(['ls', '-l', source_root])
# testbed.execute(['pwd'])
print(artifact_pattern)
# remove any existing artifact, in case the build script doesn't overwrite
# it e.g. like how make(1) sometimes works.
testbed.check_exec(
['sh', '-ec', 'cd "%s" && rm -rf %s' %
(source_root, artifact_pattern)])
# cd = _shell_ast.SimpleCommand('', 'cd', _shell_ast.CmdSuffix([source_root]))
# new_script = (_shell_ast.List([_shell_ast.Term(cd, ';')]) + script)
cd = _shell_ast.SimpleCommand.make('cd', source_root)
......
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