Skip to content

Commit

Permalink
fix: sh retcode from the last real build plan shell command
Browse files Browse the repository at this point in the history
  • Loading branch information
ahlinc committed Nov 17, 2024
1 parent 6c90234 commit 360e791
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion package.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,15 @@ def execute(self, build_plan, zip_stream, query):
with tempfile.NamedTemporaryFile(mode="w+t", delete=True) as temp_file:
path, script = action[1:]
# NOTE: Execute `pwd` to determine the subprocess shell's working directory after having executed all other commands.
script = f"{script}\npwd >{temp_file.name}"
script = "\n".join(
(
script,
"retcode=$?",
f"pwd >{temp_file.name}",
"exit $retcode",
)
)

p = subprocess.Popen(
script,
shell=True,
Expand Down

0 comments on commit 360e791

Please sign in to comment.