Sha256: d2aaa1cef7daa39811594a6235e49a99abd248446dc58a71b74a0816f3d7ad10

Contents?: true

Size: 749 Bytes

Versions: 7

Compression:

Stored size: 749 Bytes

Contents

require_relative "base"

module PodPrebuild
  class CachePusher < CommandExecutor
    attr_reader :cache_branch

    def initialize(options)
      super(options)
      @cache_branch = options[:cache_branch]
    end

    def run
      Pod::UI.step("Pushing cache") do
        if @config.local_cache?
          print_message_for_local_cache
        else
          commit_and_push_cache
        end
      end
    end

    private

    def print_message_for_local_cache
      Pod::UI.puts "Skip pushing cache as you're using local cache".yellow
    end

    def commit_and_push_cache
      commit_message = "Update prebuilt cache"
      git("add .")
      git("commit -m '#{commit_message}'")
      git("push origin #{@cache_branch}")
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
cocoapods-binary-cache-next-0.1.16 lib/command/executor/pusher.rb
cocoapods-binary-cache-next-0.1.15 lib/command/executor/pusher.rb
cocoapods-binary-ht-1.0.0 lib/command/executor/pusher.rb
cocoapods-binary-cache-0.1.14 lib/command/executor/pusher.rb
cocoapods-binary-cache-0.1.13 lib/command/executor/pusher.rb
cocoapods-binary-cache-0.1.12 lib/command/executor/pusher.rb
cocoapods-binary-cache-0.1.11 lib/command/executor/pusher.rb