Skip to content

Commit 360e791

Browse files
committed
fix: sh retcode from the last real build plan shell command
1 parent 6c90234 commit 360e791

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

package.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,15 @@ def execute(self, build_plan, zip_stream, query):
943943
with tempfile.NamedTemporaryFile(mode="w+t", delete=True) as temp_file:
944944
path, script = action[1:]
945945
# NOTE: Execute `pwd` to determine the subprocess shell's working directory after having executed all other commands.
946-
script = f"{script}\npwd >{temp_file.name}"
946+
script = "\n".join(
947+
(
948+
script,
949+
"retcode=$?",
950+
f"pwd >{temp_file.name}",
951+
"exit $retcode",
952+
)
953+
)
954+
947955
p = subprocess.Popen(
948956
script,
949957
shell=True,

0 commit comments

Comments
 (0)