Sha256: 6a5a10670506d744407a653fe426397a67492a1e1af0cc59a5dc775b9ed11994
Contents?: true
Size: 1.35 KB
Versions: 1
Compression:
Stored size: 1.35 KB
Contents
require_relative "base" require_relative "../helper/zip" module PodPrebuild class CacheFetcher < CommandExecutor def initialize(options) super(options) @cache_branch = options[:cache_branch] end def run Pod::UI.step("Fetching cache") do fetch_cache(@config.cache_repo, @cache_branch, @config.cache_path) unzip_cache end end private def fetch_cache(repo, branch, dest_dir) Pod::UI.puts "Fetching cache from #{repo} (branch: #{branch})".green if Dir.exist?(dest_dir + "/.git") git("fetch origin #{branch}") git("checkout -f FETCH_HEAD", ignore_output: true) git("branch -D #{branch} || true", ignore_output: true, can_fail: true) git("checkout -b #{branch}") else FileUtils.rm_rf(dest_dir) git_clone("--depth=1 --branch=#{branch} #{repo} #{dest_dir}") end end def unzip_cache Pod::UI.puts "Unzipping cache: #{@config.cache_path} -> #{@config.prebuild_path}".green FileUtils.rm_rf(@config.prebuild_path) FileUtils.mkdir_p(@config.prebuild_path) FileUtils.cp(@config.manifest_path(in_cache: true), @config.manifest_path) Dir[@config.generated_frameworks_dir(in_cache: true) + "/*.zip"].each do |path| ZipUtils.unzip(path, to_dir: @config.generated_frameworks_dir) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cocoapods-binary-cache-0.1.1 | lib/command/executor/fetcher.rb |