aboutsummaryrefslogtreecommitdiffstats
path: root/homebrew/sync-brewfile.sh
blob: fbe45e0c9129c767eb3b667c592709379fc904f4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash
set -eou pipefail

# Create a new Brewfile with only manually installed formulae and casks
(
  echo 'tap "neovim/neovim"'
  echo 'tap "eugenetriguba/bolt"'
  brew bundle dump --file=- --force |
    (
      grep -E "^brew" | grep -f <(brew leaves)
      brew list --cask | sed 's/^/cask "/;s/$/"/'
    ) |
    sort
) >Brewfile

echo "Brewfile has been updated with only manually installed packages."