mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
fix(tools): portable base64 encoding for image reading on macOS
This commit is contained in:
parent
77610961be
commit
3b4dfc8e22
1 changed files with 4 additions and 2 deletions
|
|
@ -580,8 +580,10 @@ class ShellFileOperations(FileOperations):
|
|||
),
|
||||
)
|
||||
|
||||
# Get base64 content
|
||||
b64_cmd = f"base64 -w 0 {self._escape_shell_arg(path)} 2>/dev/null"
|
||||
# Get base64 content — pipe through tr to strip newlines portably.
|
||||
# GNU base64 supports -w 0 but macOS base64 does not; both wrap by
|
||||
# default, so stripping with tr is portable across all backends.
|
||||
b64_cmd = f"base64 {self._escape_shell_arg(path)} 2>/dev/null | tr -d '\\n'"
|
||||
b64_result = self._exec(b64_cmd, timeout=30)
|
||||
|
||||
if b64_result.exit_code != 0:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue