From 12cfef6f3bd7f73b81fb1252766af428a4a9f524 Mon Sep 17 00:00:00 2001 From: Brandon Valentine Date: Fri, 16 Sep 2022 18:44:42 +0100 Subject: [PATCH] Add brewfile to bootstrap (#6068) Add Brewfile for bootstrapping deps on Mac Co-authored-by: Colin Seymour --- .gitignore | 1 + Brewfile | 4 ++++ CONTRIBUTING.md | 6 +----- script/bootstrap | 7 +++++++ 4 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 Brewfile diff --git a/.gitignore b/.gitignore index dc1d38c58e..2ff2113c33 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ test/fixtures/ace_modes.json *.so linguist-grammars* .venv +Brewfile.lock.json diff --git a/Brewfile b/Brewfile new file mode 100644 index 0000000000..c7cd710406 --- /dev/null +++ b/Brewfile @@ -0,0 +1,4 @@ +brew "cmake" +brew "pkg-config" +brew "icu4c" +cask "docker" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e0dda9401b..955b48053b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,11 +22,7 @@ Linguist uses the [`charlock_holmes`](https://github.com/brianmario/charlock_hol [Docker](https://www.docker.com/) is also required when adding or updating grammars. These components have their own dependencies - `icu4c`, and `cmake` and `pkg-config` respectively - which you may need to install before you can install Linguist. -For example, on macOS with [Homebrew](http://brew.sh/): -```bash -brew install cmake pkg-config icu4c -brew install --cask docker -``` +On macOS with [Homebrew](http://brew.sh/) the instructions below under Getting started will install these dependencies for you. On Ubuntu: ```bash diff --git a/script/bootstrap b/script/bootstrap index e86baee409..c928fe7270 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -4,6 +4,13 @@ set -e cd "$(dirname "$0")/.." +if [ -f "Brewfile" ] && [ "$(uname -s)" = "Darwin" ]; then + brew bundle check >/dev/null 2>&1 || { + echo "==> Installing Homebrew dependencies…" + brew bundle + } +fi + bundle config --local path vendor/gems bundle check > /dev/null 2>&1 || bundle install