Created
February 9, 2014 18:47
-
-
Save alvaromuir/8904144 to your computer and use it in GitHub Desktop.
Thor file that copies and install keys form a .heroku_config file in rails app root
This file contains 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
class Config < Thor | |
desc "heroku", "setup heroku from .heroku_config" | |
def heroku | |
puts "running Heroku config . . ." | |
config = ".heroku_config" | |
if File.exists?(config) | |
settings = File.open(config).read | |
settings.gsub!(/\r\n?/, "\n") | |
settings.each_line do |line| | |
if line.length > 2 && line.start_with?('#') == false | |
IO.popen("heroku config:set #{line.split("\n")[0]}") { |f| puts f.gets } | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment