Skip to content

Instantly share code, notes, and snippets.

@looseyi
Last active January 5, 2020 15:07
Show Gist options
  • Save looseyi/97820689ff80aa58c9791ece45d22a96 to your computer and use it in GitHub Desktop.
Save looseyi/97820689ff80aa58c9791ece45d22a96 to your computer and use it in GitHub Desktop.
fetch_remote_framework_for_target
def fetch_remote_framework_for_target(target)
existed_remote_framework = self.remote_framework_names.include?(zip_framework_name(target))
return false unless existed_remote_framework
begin
zip_framework_path = self.ftp.get(remote_framework_dir + zip_framework_name(target))
rescue
Pod::UI.puts "Retry fetch remote fameworks"
self.reset_ftp
zip_framework_path = self.ftp.get(remote_framework_dir + zip_framework_name(target))
end
return false unless File.exist?(zip_framework_path)
target_framework_path = generate_framework_path + target.name
return true unless Dir.empty?(target_framework_path)
extract_framework_path = generate_framework_path + target.name
zf = Zipper.new(zip_framework_path, extract_framework_path)
zf.extract()
true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment