From ef1d3242f85727b3e5a4eca905c75f81ae8d805b Mon Sep 17 00:00:00 2001 From: 0xmachos <0xmachos@gmail.com> Date: Sun, 25 Mar 2018 11:31:08 +0100 Subject: [PATCH 1/3] Add install_mac logic Checks if homebrew (brew) is installed then uses it to install the dependencies. Exits if homebrew is not installed and if homebrew fails to install a package. --- install | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/install b/install index f32258228..068acde93 100755 --- a/install +++ b/install @@ -115,8 +115,29 @@ install_freebsd () { } install_mac () { - # brew install ... - echo + + local mac_deps=(curl git nodejs python3 \ + openssl readline libyaml sqlite3 libxml2 \ + autoconf ncurses automake libtool \ + bison wget) + + if command_exists brew; then + fatal "Homebrew (https://brew.sh/) required to install dependencies" + fi + + info "Installing dependencies via brew" + + brew update + + for package in "${mac_deps[@]}"; do + + if brew install "${package}"; then + info "${package} installed" + else + fatal "Failed to install ${package}" + fi + + done } From 0d26f9f0bce57ed0335bac2daab4b176ad435662 Mon Sep 17 00:00:00 2001 From: 0xmachos <0xmachos@gmail.com> Date: Sun, 25 Mar 2018 11:31:24 +0100 Subject: [PATCH 2/3] Update command_exists to work on macOS --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index 068acde93..ea30fdc4f 100755 --- a/install +++ b/install @@ -17,7 +17,7 @@ RUBYSUFFIX='' command_exists () { - command -v "$1" /dev/null 2&>/dev/null + command -v "${1}" >/dev/null 2>&1 } From c240d2aae055f49d8775b9cf39d9f3c87ad37025 Mon Sep 17 00:00:00 2001 From: 0xmachos <0xmachos@gmail.com> Date: Sun, 25 Mar 2018 12:02:15 +0100 Subject: [PATCH 3/3] install_mac: update brew if check to if not --- install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install b/install index ea30fdc4f..10b2cab5d 100755 --- a/install +++ b/install @@ -121,7 +121,7 @@ install_mac () { autoconf ncurses automake libtool \ bison wget) - if command_exists brew; then + if ! command_exists brew; then fatal "Homebrew (https://brew.sh/) required to install dependencies" fi