Sha256: 52d2941def48e4e2a38e81ab7dc507ca701659c03bdf63abb350b186d6a93864

Contents?: true

Size: 814 Bytes

Versions: 4

Compression:

Stored size: 814 Bytes

Contents

module Braid
  module Commands
    class Setup < Command
      def run(path = nil)
        path ? setup_one(path) : setup_all
      end

      protected
        def setup_all
          msg "Setting up all mirrors."
          config.mirrors.each do |path|
            setup_one(path)
          end
        end

        def setup_one(path)
          mirror = config.get!(path)

          if git.remote_exists?(mirror.remote)
            msg "Mirror '#{mirror.path}/' already has a remote. Skipping."
            return
          end

          msg "Setting up remote for '#{mirror.path}/'."
          unless mirror.type == "svn"
            git.remote_add(mirror.remote, mirror.cached_url, mirror.branch)
          else
            git_svn.init(mirror.remote, mirror.url)
          end
        end
    end
  end
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
evilchelu-braid-0.4.10 lib/braid/commands/setup.rb
evilchelu-braid-0.4.11 lib/braid/commands/setup.rb
evilchelu-braid-0.4.12 lib/braid/commands/setup.rb
norbert-braid-0.4.12 lib/braid/commands/setup.rb