Skip to content

Commit

Permalink
Fix/realpath to basename (#153)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
marboledacci authored Nov 20, 2024
1 parent 93b5b48 commit bf9eeb6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/scripts/install-deps.sh
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
10 changes: 5 additions & 5 deletions src/scripts/install-ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected]
OPENSSL_LOCATION="$(brew --prefix [email protected])"
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
Expand All @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion src/scripts/install-rvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit bf9eeb6

Please sign in to comment.