summaryrefslogtreecommitdiff
path: root/xmake/modules/private/tools/codesign.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-05-15 00:45:01 +0800
committerruki <[email protected]>2021-05-15 00:45:01 +0800
commitafdbc1e7ecd6815e807901d573749a6224311545 (patch)
treed95dd13e93802e6a561f3569613e2196f917bac4 /xmake/modules/private/tools/codesign.lua
parent901c937daf4e72aac6de2019f1107ba0b885ee1b (diff)
improve and fix find codesign
Diffstat (limited to 'xmake/modules/private/tools/codesign.lua')
-rw-r--r--xmake/modules/private/tools/codesign.lua17
1 files changed, 9 insertions, 8 deletions
diff --git a/xmake/modules/private/tools/codesign.lua b/xmake/modules/private/tools/codesign.lua
index f74c36f5b..42ca094bc 100644
--- a/xmake/modules/private/tools/codesign.lua
+++ b/xmake/modules/private/tools/codesign.lua
@@ -48,16 +48,17 @@ function codesign_identities()
local identities = _g.identities
if identities == nil then
identities = {}
- local results = try { function() return os.iorun("/usr/bin/security find-identity -v -p codesigning") end }
- if not results then
- results = try { function() return os.iorun("/usr/bin/security find-identity") end }
- if results then
- local splitinfo = results:split("Valid identities only", {plain = true})
- if splitinfo and #splitinfo > 1 then
- results = splitinfo[2]
- end
+ local results = try { function() return os.iorun("/usr/bin/security find-identity") end }
+ if results then
+ local splitinfo = results:split("Valid identities only", {plain = true})
+ if splitinfo and #splitinfo > 1 then
+ results = splitinfo[2]
end
end
+ if not results then
+ -- it may be slower
+ results = try { function() return os.iorun("/usr/bin/security find-identity -v -p codesigning") end }
+ end
if results then
for _, line in ipairs(results:split('\n', {plain = true})) do
local sign, identity = line:match("%) (%w+) \"(.+)\"")