Commit 85b64c4a authored by Phil Smith's avatar Phil Smith Committed by Mislav Marohnić
Browse files

Fix JRuby install on systems with non-BSD `sed`

There doesn't seem to be a way to construct a sed invocation for
in-place editing that is compatible with both BSD and GNU sed.

http://stackoverflow.com/q/5694228/11687

Fixes #475
parent 578f0c5c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -519,7 +519,8 @@ install_jruby_launcher() {
fix_jruby_shebangs() {
  for file in "${PREFIX_PATH}/bin"/*; do
    if [ "$(head -c 20 "$file")" = "#!/usr/bin/env jruby" ]; then
      sed -i '' -E "1s:.+:#\!${PREFIX_PATH}/bin/jruby:" "$file"
      sed -i.bak -E "1s:.+:#\!${PREFIX_PATH}/bin/jruby:" "$file"
      rm "$file".bak
    fi
  done
}