build.run: ensure shell script is run with /bin/sh.

Fixes #665.
This commit is contained in:
Catherine 2023-02-06 17:04:14 +00:00
parent dafefa87a9
commit 666ee27fd0

View file

@ -169,8 +169,9 @@ class BuildPlan:
channel = transport.open_session()
channel.set_combine_stderr(True)
cmd = "if [ -f ~/.profile ]; then . ~/.profile; fi && cd {} && sh {}.sh".format(root, self.script)
channel.exec_command(cmd)
cmd = (f"if [ -f ~/.profile ]; then . ~/.profile; fi && "
f"cd {root} && exec $0 {self.script}.sh")
channel.exec_command(f"sh -c '{cmd}'")
# Show the output from the server while products are built.
buf = channel.recv(1024)