From 096defaf611b7e4845cfcc1b7a2e9394b4e4caf1 Mon Sep 17 00:00:00 2001 From: Konstantin Gredeskoul Date: Sun, 1 Dec 2024 19:21:07 -0800 Subject: [PATCH] More output during installation --- bin/install-dev-tooling | 46 ++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 14 deletions(-) diff --git a/bin/install-dev-tooling b/bin/install-dev-tooling index 898f9508..d59b85d9 100755 --- a/bin/install-dev-tooling +++ b/bin/install-dev-tooling @@ -2,6 +2,13 @@ # shellcheck disable=SC1091,SC2002,SC2207 # vim: ft=bash +if [[ $(uname -s) != "Darwin" ]]; then + echo -e "\e[31;1mERROR: This script is only supported on OS-X.\e[0m" + exit 1 +fi + +echo "Please wait while we install BASH dependencies..." + export BASHMATIC_HOME="${BASHMATIC_HOME:-"${HOME}/.bashmatic"}" [[ -z ${BASHMATIC_HOME} ]] && export BASHMATIC_HOME="${HOME}/.bashmatic" [[ -d ${BASHMATIC_HOME} ]] || bash -c "$(curl -fsSL https://bashmatic.re1.re); bashmatic-install -q" @@ -19,7 +26,7 @@ output.constrain-screen-width 100 declare -g timestamp export timestamp="$(time.now.db)" -h1 "Installing Brew Packages..." +h3bg "Installing Brew Packages..." run.set-all continue-on-error run "brew bundle --no-upgrade --no-lock" run.set-all abort-on-error @@ -29,28 +36,39 @@ if [[ -d ~/.vim && -f ~/.vimrc ]]; then run "cp -p -v ~/.vimrc ~/.vimrc.${timestamp}" fi -h1 "Installing custom vim configuration locally..." +h3bg "Installing custom vim configuration locally..." run "cp -f development/config/.vimrc ${HOME}" run "cp -f development/config/.vimrc.customizations ${HOME}" -h1 "Installing VIM Plugins... Please wait." +h3bg "Installing VIM Plugins... Please wait." run.set-next show-output-on run "vim -E +PlugInstall +qall" -h1 "Installing ~/.psqlrc" +h3bg "Installing ~/.psqlrc" run "mv ~/.psqlrc ~/.psqlrc.${timestamp}" run.set-next show-output-on run "cp -p -v development/config/.psqlrc* ${HOME}" -h1 "Installing Ruby" -run "brew update && brew install rbenv ruby-build" -run "brew install jemalloc rust" -h2 "Building Ruby... with Jemalloc & YJIT" +export ruby_version="$(cat .ruby-version | tr -d '\n')" -run.set-all abort-on-error +if [[ -z $(rbenv versions | grep "${ruby_version}") ]]; then + h3bg "Installing Ruby" + + run "brew update && brew install rbenv ruby-build" + run "brew install jemalloc rust" + h2 "Building Ruby... with Jemalloc & YJIT" + + run.set-all abort-on-error + + unset CFLAGS + export RUBY_CFLAGS="-Wno-error=implicit-function-declaration" + run.set-next show-output-on + run "RUBY_CONFIGURE_OPTS='--enable-yjit --with-jemalloc' rbenv install -f ${ruby_version}" +else + rbenv local "${ruby_version}" + success "Ruby ${ruby_version} was already installed." +fi + +run.set-next abort-on-error +[[ -f Gemfile ]] && run "bundle install -j 4" -unset CFLAGS -export RUBY_CFLAGS="-Wno-error=implicit-function-declaration" -run.set-next show-output-on -run "RUBY_CONFIGURE_OPTS='--enable-yjit --with-jemalloc' rbenv install -f $(cat .ruby-version | tr -d '\n')" -run "bundle install -j 4"