Skip to content
Myr

Make install script prefer system ruby

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Junegunn Choi · committed by Junegunn Choi · parent 3723829 · Browse files · 1 file+13 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+13 added−4 removed

  • other:+13 added−4 removed

1 file+13 added−4 removed

modified:install+13 added-4 removed
8 unmodified lines
9if [ $? -ne 0 ]; then10 echo "ruby executable not found!"11 exit 112fi13echo "OK"1314# System ruby is preferred15curses_check="begin; require 'curses'; rescue Exception; exit 1; end"16system_ruby=/usr/bin/ruby17if [ -x $system_ruby -a $system_ruby != "$ruby" ]; then18 $system_ruby --disable-gems -e "$curses_check" 2> /dev/null19 [ $? -eq 0 ] && ruby=$system_ruby20fi2122echo "OK ($ruby)"2324# Curses-support25echo -n "Checking Curses support ... "17/usr/bin/env ruby -e "begin; require 'curses'; rescue Exception; exit 1; end"26"$ruby" -e "$curses_check"27if [ $? -eq 0 ]; then28 echo "OK"29else30 echo "Not found"
7 unmodified lines
38fi3940# Ruby version41echo -n "Checking Ruby version ... "33/usr/bin/env ruby -e 'exit RUBY_VERSION >= "1.9"'42"$ruby" -e 'exit RUBY_VERSION >= "1.9"'43if [ $? -eq 0 ]; then44 echo ">= 1.9"36 /usr/bin/env ruby --disable-gems -e "begin; require 'curses'; rescue Exception; exit 1; end"45 "$ruby" --disable-gems -e "$curses_check"46 if [ $? -eq 0 ]; then47 fzf_cmd="$ruby --disable-gems $fzf_base/fzf"48 else49 fzf_cmd="$ruby $fzf_base/fzf"
135 unmodified lines