Skip to content
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

Don't allow spaces in IPA file name being uploaded to ITC #12321

Merged
merged 3 commits into from
Apr 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def generate(app_id: nil, ipa_path: nil, package_path: nil, platform: nil)
end

def unique_ipa_path(ipa_path)
"#{File.basename(ipa_path, '.ipa')}_#{Digest::SHA256.file(ipa_path).hexdigest}.ipa"
basename = File.basename(ipa_path, '.ipa').gsub(' ', '_')
"#{basename}_#{Digest::SHA256.file(ipa_path).hexdigest}.ipa"
end

private
Expand Down
Binary file not shown.
8 changes: 8 additions & 0 deletions fastlane_core/spec/ipa_upload_package_builder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
let(:uploader) { FastlaneCore::IpaUploadPackageBuilder.new }
let(:unique_path) { uploader.unique_ipa_path(path) }

let(:ipa_with_spaces) { 'iOS App With Spaces' }
let(:path_with_spaces) { File.expand_path("../fixtures/ipas/#{ipa_with_spaces}.ipa", __FILE__) }
let(:unique_path_with_spaces) { uploader.unique_ipa_path(path_with_spaces) }

def special_chars?(string)
string =~ /^[A-Za-z0-9_\.]+$/ ? false : true
end
Expand Down Expand Up @@ -43,6 +47,10 @@ def special_chars?(string)
expect(unique_path).not_to(start_with(okay_char))
end
end

it 'does not contain any spaces' do
expect(unique_path_with_spaces.include?(' ')).to eq(false)
end
end
end
end