From 375b54da971d5cc719b60b963256192669ed5203 Mon Sep 17 00:00:00 2001 From: Jeremy Hinegardner Date: Tue, 11 Feb 2025 19:06:05 -0700 Subject: [PATCH] switch to ensuring that ruby-build is installed --- .semaphore/ensure-ruby-build.sh | 10 ++++++++++ .semaphore/semaphore.yml | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .semaphore/ensure-ruby-build.sh diff --git a/.semaphore/ensure-ruby-build.sh b/.semaphore/ensure-ruby-build.sh new file mode 100644 index 0000000..2ddf28e --- /dev/null +++ b/.semaphore/ensure-ruby-build.sh @@ -0,0 +1,10 @@ +# +# Ensure that ruby-build is installed so we can have the right ruby version +# +if [ -d "$(rbenv root)/plugins/ruby-build" ]; then + echo "Updating ruby-build" + git -C "$(rbenv root)/plugins/ruby-build" pull +else + echo "Installing ruby-build" + git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build +fi diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 9e5eaab..f875062 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -17,7 +17,7 @@ blocks: commands: - checkout - sudo apt-get update && sudo apt-get install -y libyaml-dev - - git -C ${HOME}/.rbenv/plugins/ruby-build pull + - source .semaphore/ensure-ruby-build.sh epilogue: always: commands: @@ -52,7 +52,7 @@ blocks: prologue: commands: - checkout - - git -C ${HOME}/.rbenv/plugins/ruby-build pull + - source .semaphore/ensure-ruby-build.sh jobs: - name: macos matrix test matrix: