From 256168182c287218f7b53ae58cc52ebcc8763638 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Tue, 8 Nov 2022 10:28:03 -0800 Subject: [PATCH 1/3] Restart rather than start Postgres When running the script multiple times (because, say, ruby won't install properly), it will fail to start Postgres if it's already started. I believe this version of the command works whether Postgres has been started in the past or not. --- mac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mac b/mac index 397ab4c..625ae19 100644 --- a/mac +++ b/mac @@ -48,7 +48,7 @@ log_info "Installing Postgres, a good open source relational database ..." brew install postgresql@14 log_info "Starting Postgres ..." - brew services start postgresql@14 + brew services restart postgresql@14 log_info "Installing Redis, a good key-value database ..." brew install redis From ac28a4a3e412d39f5d9d2d6a60d9be8cb5062cb9 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Tue, 8 Nov 2022 11:33:55 -0800 Subject: [PATCH 2/3] Skip if Ruby version already installed If you already have the designated version of Ruby, just skip this step. Without this option, you must wait for Ruby to be needlessly reinstalled each time you run the script. No real risk to skipping unless you have a screwed up install in the first place. --- mac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mac b/mac index 625ae19..11dacce 100644 --- a/mac +++ b/mac @@ -89,7 +89,7 @@ log_info "Installing coreutils ..." ruby_version="2.7.3" log_info "Installing Ruby $ruby_version ..." - rbenv install "$ruby_version" + rbenv install -s "$ruby_version" log_info "Setting $ruby_version as global default Ruby ..." rbenv global "$ruby_version" From c2444ab5965f4bb5067cdf3e4758509429638412 Mon Sep 17 00:00:00 2001 From: Jon Ericson Date: Tue, 8 Nov 2022 11:44:58 -0800 Subject: [PATCH 3/3] Restart rather than start Redis Doesn't throw an error if Redis is already started, but doesn't update to the latest Redis if it's just been installed. (See: https://github.com/discourse/prometheus_exporter/pull/250) --- mac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mac b/mac index 11dacce..225492b 100644 --- a/mac +++ b/mac @@ -54,7 +54,7 @@ log_info "Installing Redis, a good key-value database ..." brew install redis log_info "Starting Redis ..." - brew services start redis + brew services restart redis log_info "Installing and linking ImageMagick, to crop and resize images ..." brew install imagemagick