Sha256: ee189caf8fc895960f50ea3ec0d299ed0bec73bb8e14b39823846dc70292067e

Contents?: true

Size: 654 Bytes

Versions: 7

Compression:

Stored size: 654 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
        Hanzo.config['remotes']
      end

      def self.installed_environments
        `git remote`.split("\n")
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hanzo-1.0.2 lib/hanzo/modules/installers/remotes.rb
hanzo-1.0.1 lib/hanzo/modules/installers/remotes.rb
hanzo-1.0.0 lib/hanzo/modules/installers/remotes.rb
hanzo-0.6.2 lib/hanzo/modules/installers/remotes.rb
hanzo-0.6.1 lib/hanzo/modules/installers/remotes.rb
hanzo-0.6 lib/hanzo/modules/installers/remotes.rb
hanzo-0.5 lib/hanzo/modules/installers/remotes.rb