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