Skip to content

Instantly share code, notes, and snippets.

@dtan4
Last active August 29, 2015 14:00
Show Gist options
  • Save dtan4/11075259 to your computer and use it in GitHub Desktop.
Save dtan4/11075259 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
filepath = ENV["HOME"] + "/git/dotfiles/Brewfile"
lines = []
open(filepath).each do |line|
next if line.strip == ""
next if line =~ /^tap/
lines << line.split(" ")
end
normal_brews = lines.select { |line| line[0] == "install" }.sort_by { |line| line[1] }.map { |line| line.join(" ") }
cask_brews = lines.select { |line| line[0] == "cask" }.sort_by { |line| line[2] }.map { |line| line.join(" ") }
puts normal_brews
puts ""
puts cask_brews
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment