aboutsummaryrefslogtreecommitdiff
path: root/src/ruby
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-06-06 19:38:02 +0300
committerGitHub <noreply@github.com>2022-06-06 19:38:02 +0300
commit07f2b34faba9785646647c27a8445912df57fdc6 (patch)
treeb46ec6dde4ce7b515c4a5cbe6fb280762697938c /src/ruby
parenta87dca40b5763cfcdb0881b0b589a05766ce7e04 (diff)
fix miscellaneous bugs (#41)
* add recursive linking * temp change * fix xdebug * fix rbenv xdebug * fix hugo * remove suffix * php: fix config * fix anaconda and oryx * fix xdebug * fixes php * bug fix: composer * anaconda * nit * fix shellchecker * shellchecker
Diffstat (limited to 'src/ruby')
-rw-r--r--src/ruby/install.sh54
1 files changed, 33 insertions, 21 deletions
diff --git a/src/ruby/install.sh b/src/ruby/install.sh
index 2e9b37a..f4c7b10 100644
--- a/src/ruby/install.sh
+++ b/src/ruby/install.sh
@@ -191,7 +191,7 @@ fi
find_version_from_git_tags RUBY_VERSION "https://github.com/ruby/ruby" "tags/v" "_"
# Just install Ruby if RVM already installed
-if [ rvm --version != ""]; then
+if [ $(rvm --version) != "" ]; then
echo "Ruby Version Manager already exists."
if [ "${RUBY_VERSION}" != "none" ]; then
echo "Installing specified Ruby version."
@@ -241,29 +241,41 @@ fi
updaterc "if ! grep rvm_silence_path_mismatch_check_flag \$HOME/.rvmrc > /dev/null 2>&1; then echo 'rvm_silence_path_mismatch_check_flag=1' >> \$HOME/.rvmrc; fi\nsource /usr/local/rvm/scripts/rvm > /dev/null 2>&1"
# Install rbenv/ruby-build for good measure
-if [ ${SKIP_RBENV_RBUILD} != "true"] ; then
- git clone --depth=1 \
- -c core.eol=lf \
- -c core.autocrlf=false \
- -c fsck.zeroPaddedFilemode=ignore \
- -c fetch.fsck.zeroPaddedFilemode=ignore \
- -c receive.fsck.zeroPaddedFilemode=ignore \
- https://github.com/rbenv/rbenv.git /usr/local/share/rbenv
- ln -s /usr/local/share/rbenv/bin/rbenv /usr/local/bin
- updaterc 'eval "$(rbenv init -)"'
- git clone --depth=1 \
- -c core.eol=lf \
- -c core.autocrlf=false \
- -c fsck.zeroPaddedFilemode=ignore \
- -c fetch.fsck.zeroPaddedFilemode=ignore \
- -c receive.fsck.zeroPaddedFilemode=ignore \
- https://github.com/rbenv/ruby-build.git /usr/local/share/ruby-build
- mkdir -p /root/.rbenv/plugins
- ln -s /usr/local/share/ruby-build /root/.rbenv/plugins/ruby-build
+if [ "${SKIP_RBENV_RBUILD}" != "true" ]; then
+
+ if [[ ! -d "/usr/local/share/rbenv" ]]; then
+ git clone --depth=1 \
+ -c core.eol=lf \
+ -c core.autocrlf=false \
+ -c fsck.zeroPaddedFilemode=ignore \
+ -c fetch.fsck.zeroPaddedFilemode=ignore \
+ -c receive.fsck.zeroPaddedFilemode=ignore \
+ https://github.com/rbenv/rbenv.git /usr/local/share/rbenv
+
+ ln -s /usr/local/share/rbenv/bin/rbenv /usr/local/bin
+ updaterc 'eval "$(rbenv init -)"'
+ fi
+
+ if [[ ! -d "/usr/local/share/ruby-build" ]]; then
+ git clone --depth=1 \
+ -c core.eol=lf \
+ -c core.autocrlf=false \
+ -c fsck.zeroPaddedFilemode=ignore \
+ -c fetch.fsck.zeroPaddedFilemode=ignore \
+ -c receive.fsck.zeroPaddedFilemode=ignore \
+ https://github.com/rbenv/ruby-build.git /usr/local/share/ruby-build
+ mkdir -p /root/.rbenv/plugins
+
+ ln -s /usr/local/share/ruby-build /root/.rbenv/plugins/ruby-build
+ fi
+
if [ "${USERNAME}" != "root" ]; then
mkdir -p /home/${USERNAME}/.rbenv/plugins
chown -R ${USERNAME} /home/${USERNAME}/.rbenv
- ln -s /usr/local/share/ruby-build /home/${USERNAME}/.rbenv/plugins/ruby-build
+
+ if [[ ! -d "/home/${USERNAME}/.rbenv/plugins/ruby-build" ]]; then
+ ln -s /usr/local/share/ruby-build /home/${USERNAME}/.rbenv/plugins/ruby-build
+ fi
fi
fi