Skip to content

Commit

Permalink
Don't allow spaces in IPA file name being uploaded to ITC (#12321)
Browse files Browse the repository at this point in the history
* Don't allow spaces in IPA file name being uploaded to ITC

* Space stuff

* Space stuff
  • Loading branch information
Josh Holtz committed Apr 17, 2018
1 parent d0c3b3f commit 61a16a2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
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

0 comments on commit 61a16a2

Please sign in to comment.