Skip to content

Instantly share code, notes, and snippets.

@ulhas
Created March 21, 2016 09:28
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ulhas/917182d7136cae4d726b to your computer and use it in GitHub Desktop.
Save ulhas/917182d7136cae4d726b to your computer and use it in GitHub Desktop.
Fastlane - private lane for 'package_framework`
desc "Zip and copy to right folder"
private_lane :package_framework do |lane|
if !lane[:framework]
raise "No framework specified!".red
end
if !lane[:version]
raise "No version specified!".red
end
framework = lane[:framework]
version = lane[:version]
destination_path = "#{framework}"
framework_path = "#{destination_path}/Frameworks"
source_path = "#{framework}.framework"
zip_file = "#{version}.zip"
FileUtils::mkdir_p "../build/#{framework_path}"
FileUtils::rm_rf "../build/#{framework_path}/#{framework}.framework"
FileUtils::cp_r "../build/#{source_path}", "../build/#{framework_path}"
FileUtils::rm_rf "../build/#{zip_file}"
sh "cd ../build
zip -r -X #{zip_file} #{destination_path}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment