mirror of
https://github.com/rbenv/ruby-build.git
synced 2025-09-03 15:51:32 +02:00
Fix fixing JRuby shebangs on macOS
LC_CTYPE is "utf-8" on macOS, which instructs utilities like `tr` to expect Unicode input. However, in case of binary files, which we here explicitly guard against, the utility will fail because of invalid input encoding. The solution is to set LC_CTYPE=C which effectively removes the expectation around input encoding and allows `tr` to process the input byte-by-byte.
This commit is contained in:
parent
99fda28fc4
commit
c3bae8b6a9
1 changed files with 1 additions and 1 deletions
|
@ -793,7 +793,7 @@ install_jruby_launcher() {
|
|||
|
||||
fix_jruby_shebangs() {
|
||||
for file in "${PREFIX_PATH}/bin"/*; do
|
||||
if [ "$(head -c 20 "$file" | tr -d '\0')" = "#!/usr/bin/env jruby" ]; then
|
||||
if [ "$(head -c 20 "$file" | LC_CTYPE=C tr -d '\0')" = "#!/usr/bin/env jruby" ]; then
|
||||
sed -i.bak "1 s:.*:#\!${PREFIX_PATH}\/bin\/jruby:" "$file"
|
||||
rm "$file".bak
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue