File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 28
28
error " Unable to find executable \" ${target} \" "
29
29
fi
30
30
31
- if [ -z " ${selection## [0-9]* } " ]; then
31
+ if [[ " ${selection} " =~ ^ [0-9]+$ ] ]; then
32
32
certificate=" $( echo " ${identities} " \
33
33
| awk " NR==${selection} {print \$ 2}" ) "
34
34
else
35
35
certificate=" $( echo " ${identities} " \
36
- | awk ' BEGIN{FS=OFS="\""} {gsub(/ /,"\\ ",$2)} 1' \
37
- | awk " \$ 3== \"\\\" ${selection// / _} \\\"\" {print \$ 2}" ) "
36
+ | awk ' BEGIN{FS=OFS="\""} {gsub(/ /,"_ ",$2)} 1' \
37
+ | awk " \$ 3 ~ / ${selection// / _} / {print \$ 2}" ) "
38
38
fi
39
39
40
40
if [ -z " ${certificate} " ]; then
41
41
error " Unable to find codesigning certificate \" ${selection} \" "
42
+ elif [ " $( echo " ${certificate} " | wc -l) " -ne 1 ]; then
43
+ error " Unable to uniquely identify codesigning certificate \" ${selection} \" "
42
44
fi
43
45
44
46
command codesign --deep --force --verbose --sign " ${certificate} " " ${target} "
You can’t perform that action at this time.
0 commit comments