-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds check for whether directory is actually a bundle before moving children out #85
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,7 +110,7 @@ def extract_with_type(full_filename, type = :zip) | |
contents = target_path.children | ||
contents.delete(target_path + @filename) | ||
entry = contents.first | ||
if contents.count == 1 && entry.directory? | ||
if contents.count == 1 && entry.directory? && !isBundle?(entry) | ||
tmp_entry = entry.sub_ext("#{entry.extname}.tmp") | ||
begin | ||
FileUtils.move(entry, tmp_entry) | ||
|
@@ -173,6 +173,20 @@ def verify_checksum(filename) | |
verify_sha1_hash(filename, options[:sha1]) | ||
end | ||
end | ||
|
||
# @note The entry is a bundle if it is a directory but has a bundle structure | ||
# | ||
# @return [Bool] Whether the entry is a bundle | ||
# | ||
|
||
def isBundle?(entry) | ||
isBundle = File.extname(entry) == '.framework' | ||
isBundle ||= File.extname(entry) == '.app' | ||
isBundle ||= File.extname(entry) == '.framework' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this duplicated? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what about There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correct, I accidentally duplicated the line. Will correct and commit change. As for the resource.bundles, should cocoapods check just for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep any |
||
isBundle ||= File.extname(entry) == '.ipa' | ||
isBundle ||= File.extname(entry) == '.xcappdata' | ||
isBundle | ||
end | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: rename to
is_bundle?
and remove the extra empty line above the function declarationThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can rename the method and remove the line, but I don't know how to write unit tests in ruby.
As for the
CHANGELOG
entry, I also wasn't sure of the proper git flow for Cocoapods, so I made the PR into master. Should I then put the entry under Master > Bug Fixes?