Sha256: edc09110ce6d7520c3292906d2df210d0a2ccf9c0e97f2e0e99c867bf3f00f5e

Contents?: true

Size: 742 Bytes

Versions: 1

Compression:

Stored size: 742 Bytes

Contents

require 'r10k/cli'
require 'r10k/synchro/git'
require 'cri'
require 'r10k/logging'

module R10K::CLI
  module Cache
    def self.command
      @cmd ||= Cri::Command.define do
        name  'cache'
        usage 'cache'
        summary 'Update cache for all sources'

        run do |opts, args, cmd|
          sources = R10K::Deployment.instance[:sources]
          remotes = Set.new

          sources.each_pair do |name, hash|
            remotes << hash['remote']
          end

          remotes.each do |remote|
            logger.info "Synchronizing #{remote}"
            synchro = R10K::Synchro::Git.new(remote)
            synchro.cache
          end
        end
      end
    end
  end
  self.command.add_command(Cache.command)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
r10k-0.0.6 lib/r10k/cli/cache.rb