Sha256: b5123f4d1451b469584aa0016b72dbf949676d8c75bf142b6c43a65591bf2047

Contents?: true

Size: 830 Bytes

Versions: 1

Compression:

Stored size: 830 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.url, mirror.branch)
          else
            git_svn.init(mirror.remote, mirror.url)
          end
          mirror.fetch
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tapajos-braid-0.4.9.1 lib/braid/commands/setup.rb