mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-06-13 17:46:31 +08:00
[CodeSign] Cleanup.
This commit is contained in:
@@ -333,13 +333,17 @@ EOS
|
||||
|
||||
def codesign_certificate(platform)
|
||||
@codesign_certificate ||= begin
|
||||
cert_type = (distribution_mode ? 'Distribution' : 'Developer')
|
||||
certs = Util::CodeSign.identity_names(release?).grep(/#{platform} #{cert_type}/)
|
||||
type = (distribution_mode ? 'Distribution' : 'Developer')
|
||||
certs = Util::CodeSign.identity_names(release?)
|
||||
certs = certs.grep(/#{platform} #{type}/)
|
||||
if certs.size == 0
|
||||
App.fail "Cannot find any #{platform} #{cert_type} certificate in the keychain"
|
||||
App.fail "Cannot find any #{platform} #{type} certificate in the" \
|
||||
"keychain"
|
||||
elsif certs.size > 1
|
||||
# TODO list all the values for the user's convenience.
|
||||
App.warn "Found #{certs.size} #{platform} #{cert_type} certificates in the keychain. Set the `codesign_certificate' project setting to explicitely use one of (defaults to the first): #{certs.join(', ')}"
|
||||
App.warn "Found #{certs.size} #{platform} #{type} certificates in " \
|
||||
"the keychain. Set the `codesign_certificate' project " \
|
||||
"setting to explicitely use one of (defaults to the " \
|
||||
"first): #{certs.join(', ')}"
|
||||
end
|
||||
certs.first
|
||||
end
|
||||
|
||||
@@ -7,7 +7,9 @@ module Motion; module Util
|
||||
# @returns String The raw output from querying the `security` DB.
|
||||
#
|
||||
def query_security_db_for_identities(valid_only)
|
||||
`/usr/bin/security -q find-identity -p codesigning#{' -v' if valid_only}`.strip
|
||||
command = '/usr/bin/security -q find-identity -p codesigning'
|
||||
command << ' -v' if valid_only
|
||||
`#{command}`.strip
|
||||
end
|
||||
|
||||
# @param Boolean valid_only Whether or not to include only valid code
|
||||
|
||||
Reference in New Issue
Block a user