Sha256: fdbe697a98d1434e2505e68ec3552a2b4682ec4b348afede6b57bb7af5a53d9f

Contents?: true

Size: 778 Bytes

Versions: 9

Compression:

Stored size: 778 Bytes

Contents

module Hanzo
  module Installers
    module Remotes
      def install_remotes
        Hanzo.title 'Creating git remotes'

        Hanzo::Installers::Remotes.environments.each_pair do |env, app|
          Hanzo::Installers::Remotes.add_remote(app, env)
        end
      end

      def self.add_remote(app, env)
        Hanzo.print "Adding #{env}"
        Hanzo.run "git remote rm #{env} 2>&1 > /dev/null"
        Hanzo.run "git remote add #{env} git@heroku.com:#{app}.git"
      end

      def self.environments
        return YAML.load_file('.heroku-remotes') if File.exists?('.heroku-remotes')

        Hanzo.print 'Cannot locate .heroku-remotes'
        Hanzo.print 'For more information, please read https://github.com/mirego/hanzo'
        exit
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
hanzo-0.4.2 lib/hanzo/modules/installers/remotes.rb
hanzo-0.4.1 lib/hanzo/modules/installers/remotes.rb
hanzo-0.4 lib/hanzo/modules/installers/remotes.rb
hanzo-0.3.1 lib/hanzo/modules/installers/remotes.rb
hanzo-0.3 lib/hanzo/modules/installers/remotes.rb
hanzo-0.2.3 lib/hanzo/modules/installers/remotes.rb
hanzo-0.2.2 lib/hanzo/modules/installers/remotes.rb
hanzo-0.2.1 lib/hanzo/modules/installers/remotes.rb
hanzo-0.2 lib/hanzo/modules/installers/remotes.rb