Last active
January 2, 2016 16:09
-
-
Save onigra/8327788 to your computer and use it in GitHub Desktop.
brew listからBrewfileを作るスクリプトだけどそもそもbrewdlerを使った事が無かった
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open3' | |
formula = Open3.capture3("brew list") | |
File.open("Brewfile", "w") do |file| | |
file << "update\n" | |
file << "upgrade\n" | |
file << "\n" | |
formula[0].split(/\n/).each do |f| | |
file << "install #{f}\n" | |
end | |
file << "\n" | |
file << "clean\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment