提交 c9f06b0e 编写于 作者: T Trevor Brown

Fix issue with the ruby-build version check.

上级 784e9bb5
......@@ -11,13 +11,13 @@ ensure_ruby_build_setup() {
}
ensure_ruby_build_installed() {
echo "got here"
local ruby_build_version
if [ ! -f "$(ruby_build_path)" ]; then
download_ruby_build
else
local ruby_build_version="$("$(ruby_build_path)" --version | cut -d ' ' -f2)"
echo $ruby_build_version
if [ "$("$(ruby_build_path)" --version)" != "$RUBY_BUILD_VERSION" ]; then
current_ruby_build_version="$("$(ruby_build_path)" --version | cut -d ' ' -f2)"
if [ "$current_ruby_build_version" != "$RUBY_BUILD_VERSION" ]; then
# If the ruby-build directory already exists and the version does not
# match, remove it and download the correct version
rm -rf "$(ruby_build_dir)"
......@@ -33,27 +33,21 @@ download_ruby_build() {
# Clone down and checkout the correct ruby-build version
git clone https://github.com/rbenv/ruby-build.git $build_dir >&2 >/dev/null
$(cd $build_dir; git checkout $RUBY_BUILD_TAG)
(cd $build_dir; git checkout $RUBY_BUILD_TAG >&2 >/dev/null)
# Install in the ruby-build dir
PREFIX="$(ruby_build_dir)" ./$build_dir/install.sh
# Remove ruby-build source dir
rm -rf ruby-build-source
rm -rf $build_dir
}
ruby_build_dir() {
echo "$(dirname "$(dirname $0)")/ruby-build"
echo "$(dirname "$(dirname "$0")")/ruby-build"
}
ruby_build_path() {
echo "$(ruby_build_dir)/bin/ruby-build"
}
#set_ruby_build_env() {
# local kerl_home
# kerl_home="$(dirname "$(dirname "$0")")/kerl-home"
# mkdir -p "$kerl_home"
# export KERL_BASE_DIR="$kerl_home"
# export KERL_BUILD_BACKEND="git"
# export KERL_CONFIG="$kerl_home/.kerlrc"
#}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册