Sha256: 39c7b1ed15c6eac26f17162eba20a29e2f25a5d0e62e3406562f7a8abb3d14e8

Contents?: true

Size: 533 Bytes

Versions: 1

Compression:

Stored size: 533 Bytes

Contents

module PodPrebuild
  module ZipUtils
    def self.zip(path, to_dir: nil)
      basename = File.basename(path)
      out_path = to_dir.nil? ? "#{basename}.zip" : "#{to_dir}/#{basename}.zip"
      cmd = []
      cmd << "cd" << File.dirname(path)
      cmd << "&& zip --symlinks" << out_path << basename
      cmd << "&& cd -"
      `#{cmd.join(" ")}`
    end

    def self.unzip(path, to_dir: nil)
      cmd = []
      cmd << "unzip -q" << path
      cmd << "-d" << to_dir unless to_dir.nil?
      `#{cmd.join(" ")}`
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cocoapods-binary-cache-0.1.1 lib/command/helper/zip.rb