From 9b720299b6219bab62b7e384c49f66f978523a97 Mon Sep 17 00:00:00 2001 From: Dan Olson Date: Tue, 29 Nov 2022 20:14:03 -0500 Subject: [PATCH] Use Homebrew's prefix when writing nginx config In order to support both Intel and M1 architectures, we need to use `brew --prefix` when determining where to write the local server config. --- bin/install_nginx_conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/install_nginx_conf b/bin/install_nginx_conf index 8cd06fc5..f043913d 100755 --- a/bin/install_nginx_conf +++ b/bin/install_nginx_conf @@ -3,9 +3,10 @@ require 'fileutils' require 'erb' +brew_prefix = `brew --prefix`.strip app_root = File.expand_path('../..', __FILE__) config_template_path = File.join(app_root, 'config/local-nginx.conf.erb') -nginx_servers_path = '/usr/local/etc/nginx/servers' +nginx_servers_path = "#{brew_prefix}/etc/nginx/servers" nginx_config_path = File.join(nginx_servers_path, 'mdl.conf') FileUtils.mkdir_p(nginx_servers_path)