$ cat brew-root-formulae.sh
#!/bin/sh
brew deps --installed | \
awk -F'[: ]+' \
'{
packages[$1]++
for (i = 2; i <= NF; i++)
dependencies[$i]++
}
END {
for (package in packages)
if (!(package in dependencies))
print package
}'
brew bundle dump:
Write all installed casks/formulae/images/taps into a Brewfile in the
current directory.
还有国旗:
--file
Read the Brewfile from this location.
Use --file=- to pipe to stdin/stdout.
结果我们得到例如:
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "homebrew/services"
tap "jesseduffield/lazydocker"
tap "jesseduffield/lazygit"
brew "lazydocker"
brew "lazygit"
cask "font-sauce-code-pro-nerd-font"
brew bundle [install]:
Install and upgrade (by default) all dependencies from the Brewfile.
You can specify the Brewfile location using --file or by setting the
HOMEBREW_BUNDLE_FILE environment variable.