Skip to content

Instantly share code, notes, and snippets.

@gentam
Created May 1, 2017 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gentam/c61b2c63122884ce79876f70194e4598 to your computer and use it in GitHub Desktop.
Save gentam/c61b2c63122884ce79876f70194e4598 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
brew missing | awk 'BEGIN { print "Installing missing formulae..." }
{
split($0, a)
for (i = 2; i <= NF; i++) {
dep = a[i]
if (!installed[dep]) {
print "\n------------------------------------------------------------"
print "Installing dependencies for " $1
system("brew desc " dep)
system("brew install " dep)
installed[dep] = 1
}
}
}
END { print "\nDone" }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment