fix(gateway): avoid zsh status variable in update wrapper
This commit is contained in:
@@ -12837,7 +12837,11 @@ class GatewayRunner:
|
|||||||
update_cmd = (
|
update_cmd = (
|
||||||
f"PYTHONUNBUFFERED=1 {hermes_cmd_str} update --gateway"
|
f"PYTHONUNBUFFERED=1 {hermes_cmd_str} update --gateway"
|
||||||
f" > {shlex.quote(str(output_path))} 2>&1; "
|
f" > {shlex.quote(str(output_path))} 2>&1; "
|
||||||
f"status=$?; printf '%s' \"$status\" > {shlex.quote(str(exit_code_path))}"
|
# Avoid `status=$?`: `status` is a read-only special parameter
|
||||||
|
# in zsh, and this command string is copied/reused in macOS/zsh
|
||||||
|
# operator wrappers. Keep the template zsh-safe even though this
|
||||||
|
# specific subprocess currently runs under bash.
|
||||||
|
f"rc=$?; printf '%s' \"$rc\" > {shlex.quote(str(exit_code_path))}"
|
||||||
)
|
)
|
||||||
setsid_bin = shutil.which("setsid")
|
setsid_bin = shutil.which("setsid")
|
||||||
if setsid_bin:
|
if setsid_bin:
|
||||||
|
|||||||
@@ -237,6 +237,8 @@ class TestUpdateCommandGatewayFlag:
|
|||||||
cmd_string = call_args[-1] if isinstance(call_args, list) else str(call_args)
|
cmd_string = call_args[-1] if isinstance(call_args, list) else str(call_args)
|
||||||
assert "--gateway" in cmd_string
|
assert "--gateway" in cmd_string
|
||||||
assert "PYTHONUNBUFFERED" in cmd_string
|
assert "PYTHONUNBUFFERED" in cmd_string
|
||||||
|
assert "rc=$?" in cmd_string
|
||||||
|
assert "status=$?" not in cmd_string
|
||||||
assert "stream progress" in result
|
assert "stream progress" in result
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user