From bf9eeb6a4bf7a783a03852f10cea682e810c3865 Mon Sep 17 00:00:00 2001 From: marboledacci Date: Wed, 20 Nov 2024 08:58:35 -0500 Subject: [PATCH] Fix/realpath to basename (#153) * Udpate way to calculate absolute path in install-deps * Use rvm head * Update condition * Remove manual openssl * Remove openssl 1.1 installation for old versions --- src/scripts/install-deps.sh | 4 +++- src/scripts/install-ruby.sh | 10 +++++----- src/scripts/install-rvm.sh | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/scripts/install-deps.sh b/src/scripts/install-deps.sh index ab80b1f..7339649 100644 --- a/src/scripts/install-deps.sh +++ b/src/scripts/install-deps.sh @@ -1,5 +1,7 @@ #!/usr/bin/env bash -GEMFILE_ABS_PATH=$(realpath "$PARAM_GEMFILE") +GEMFILE_ABS_PATH="$(cd "$(dirname "$PARAM_GEMFILE")" && pwd -P)/$(basename "$PARAM_GEMFILE")" + +echo "$(cd "$(dirname LICENSE)" && pwd -P)/$(basename LICENSE)" if bundle config set > /dev/null 2>&1; then if [ "$PARAM_PATH" == "./vendor/bundle" ]; then bundle config deployment 'true' diff --git a/src/scripts/install-ruby.sh b/src/scripts/install-ruby.sh index b87ec2d..520dbda 100644 --- a/src/scripts/install-ruby.sh +++ b/src/scripts/install-ruby.sh @@ -2,11 +2,11 @@ PARAM_RUBY_VERSION=$(eval echo "${PARAM_VERSION}") RUBY_VERSION_MAJOR=$(echo "$PARAM_VERSION" | cut -d. -f1) +RUBY_VERSION_MINOR=$(echo "$PARAM_VERSION" | cut -d. -f2) detected_platform="$(uname -s | tr '[:upper:]' '[:lower:]')" -if [ "$detected_platform" = "darwin" ] && [ "$RUBY_VERSION_MAJOR" -le 2 ]; then - brew install openssl@1.1 - OPENSSL_LOCATION="$(brew --prefix openssl@1.1)" - export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$OPENSSL_LOCATION" + +# When on MacOS, and versions minor or equal to 3.0.x. These are the versions depending on OpenSSL 1.1 +if [[ "$detected_platform" = "darwin" && ( "$RUBY_VERSION_MAJOR" -le 2 || ( "$RUBY_VERSION_MAJOR" -eq 3 && "$RUBY_VERSION_MINOR" -eq 0 ) ) ]]; then rbenv install $PARAM_RUBY_VERSION rbenv global $PARAM_RUBY_VERSION exit 0 @@ -21,7 +21,7 @@ elif ! openssl version | grep -q -E '1\.[0-9]+\.[0-9]+'; then # location of RVM is expected to be available at RVM_HOME env var WITH_OPENSSL="--with-openssl-dir=$RVM_HOME/usr" fi - +rvm get master rvm install "$PARAM_RUBY_VERSION" "$WITH_OPENSSL" rvm use "$PARAM_RUBY_VERSION" diff --git a/src/scripts/install-rvm.sh b/src/scripts/install-rvm.sh index 05e8a06..4a7294c 100644 --- a/src/scripts/install-rvm.sh +++ b/src/scripts/install-rvm.sh @@ -57,7 +57,7 @@ echo 7D2BAF1CF37B13E2069D6956105BD0E739499BDB:6: | gpg --import-ownertrust ## Update if RVM is installed and exit if [ -x "$(command -v rvm -v)" ]; then - rvm get stable + rvm get head exit 0 fi