fix(tools): portable base64 encoding for image reading on macOS
This commit is contained in:
@@ -580,8 +580,10 @@ class ShellFileOperations(FileOperations):
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
# Get base64 content
|
# Get base64 content — pipe through tr to strip newlines portably.
|
||||||
b64_cmd = f"base64 -w 0 {self._escape_shell_arg(path)} 2>/dev/null"
|
# 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)
|
b64_result = self._exec(b64_cmd, timeout=30)
|
||||||
|
|
||||||
if b64_result.exit_code != 0:
|
if b64_result.exit_code != 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user