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

# Create a new Brewfile with only manually installed formulae and casks
(
  echo 'tap "neovim/neovim"'
  echo 'tap "eugenetriguba/bolt", "https://git.sr.ht/~eugenetriguba/homebrew-bolt"'
  echo 'tap "eugenetriguba/justify", "https://git.sr.ht/~eugenetriguba/homebrew-justify"'
  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."