Fix install-mac.sh corrupting files on macOS#115
Open
nakomis wants to merge 1 commit intoflorentbr:masterfrom
Open
Fix install-mac.sh corrupting files on macOS#115nakomis wants to merge 1 commit intoflorentbr:masterfrom
nakomis wants to merge 1 commit intoflorentbr:masterfrom
Conversation
On macOS, echo does not support the -e flag and outputs it literally, corrupting every file written by the write() helper. This breaks the app bundle: Info.plist becomes invalid XML (so macOS cannot find the executable), and the launch script loses its shebang. Replace echo -e "$(</dev/stdin)" with cat, which reads stdin directly and is portable across all POSIX systems.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On macOS,
echodoes not support the-eflag — it outputs it literally rather than interpreting it as a flag. Thewrite()helper usesecho -e "$(</dev/stdin)", which causes every file it writes to be prefixed with-e.This corrupts two critical files in the app bundle:
Contents/Info.plist— becomes invalid XML, so macOS cannot parseCFBundleExecutableand reports "The application cannot be opened because its executable is missing."Contents/MacOS/launch— its shebang becomes-e #!/bin/bash, making it non-executableFix
Replace
echo -e "$(</dev/stdin)"withcat, which reads stdin directly and is fully portable across macOS and Linux.Testing
Verified on macOS (Apple Silicon) — after this fix,
install-mac.shcorrectly writes bothInfo.plistand thelaunchscript, and the app opens successfully.