Install curses gem when not found (#14)
This commit is contained in:
parent
33b28be941
commit
3b668ed448
@ -11,7 +11,8 @@ the likes.
|
|||||||
Requirements
|
Requirements
|
||||||
------------
|
------------
|
||||||
|
|
||||||
fzf requires Ruby (>= 1.8.5).
|
fzf requires Ruby (>= 1.8.5). 'curses' gem is required for [Ruby 2.1 or
|
||||||
|
above](https://bugs.ruby-lang.org/issues/8584).
|
||||||
|
|
||||||
Installation
|
Installation
|
||||||
------------
|
------------
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
Gem::Specification.new do |spec|
|
Gem::Specification.new do |spec|
|
||||||
spec.name = 'fzf'
|
spec.name = 'fzf'
|
||||||
spec.version = '0.6.0'
|
spec.version = '0.6.1'
|
||||||
spec.authors = ['Junegunn Choi']
|
spec.authors = ['Junegunn Choi']
|
||||||
spec.email = ['junegunn.c@gmail.com']
|
spec.email = ['junegunn.c@gmail.com']
|
||||||
spec.description = %q{Fuzzy finder for your shell}
|
spec.description = %q{Fuzzy finder for your shell}
|
||||||
@ -12,4 +12,6 @@ Gem::Specification.new do |spec|
|
|||||||
spec.bindir = '.'
|
spec.bindir = '.'
|
||||||
spec.files = %w[fzf.gemspec]
|
spec.files = %w[fzf.gemspec]
|
||||||
spec.executables = 'fzf'
|
spec.executables = 'fzf'
|
||||||
|
|
||||||
|
spec.add_runtime_dependency 'curses', '~> 1.0.0'
|
||||||
end
|
end
|
||||||
|
15
install
15
install
@ -15,11 +15,18 @@ echo "OK"
|
|||||||
# Curses-support
|
# Curses-support
|
||||||
echo -n "Checking Curses support ... "
|
echo -n "Checking Curses support ... "
|
||||||
/usr/bin/env ruby -e "begin; require 'curses'; rescue Exception; exit 1; end"
|
/usr/bin/env ruby -e "begin; require 'curses'; rescue Exception; exit 1; end"
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo "Your ruby does not support 'curses'"
|
echo "OK"
|
||||||
|
else
|
||||||
|
echo "Not found"
|
||||||
|
echo "Installing 'curses' gem ... "
|
||||||
|
/usr/bin/env gem install curses
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo "Failed to install 'curses' gem."
|
||||||
|
echo "Try installing it as root: sudo gem install curses"
|
||||||
exit 1
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
echo "OK"
|
|
||||||
|
|
||||||
# Ruby version
|
# Ruby version
|
||||||
echo -n "Checking Ruby version ... "
|
echo -n "Checking Ruby version ... "
|
||||||
@ -154,7 +161,7 @@ for shell in bash zsh; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
cat << EOF
|
cat << EOF
|
||||||
Finished. Reload your .bashrc or .zshrc to take effect.
|
Finished. Reload your .bashrc or .zshrc.
|
||||||
source ~/.bashrc # bash"
|
source ~/.bashrc # bash"
|
||||||
source ~/.zshrc # zsh"
|
source ~/.zshrc # zsh"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user