Skip to content

Commit

Permalink
Improved the method for retrieving the major version of Xcode, skip c…
Browse files Browse the repository at this point in the history
…odesign if identity is not found in codesign-pkg.sh
  • Loading branch information
tekezo committed May 5, 2024
1 parent a747851 commit 6bc77eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 3 additions & 9 deletions make-package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ set -e # forbid command failure
# Therefore, we extract the version from the Info.plist of Xcode.app

xcodeVersion=$(plutil -extract CFBundleShortVersionString raw "$(xcode-select -p)/../Info.plist")
xcodeMajorVersion=$(echo "$xcodeVersion" | sed 's|\..*$||')
echo "Xcode version: $xcodeVersion"
if [[ ${xcodeVersion%.*} -lt 15 ]]; then
echo "Xcode major version: $xcodeMajorVersion"
if [[ "$xcodeMajorVersion" -lt 15 ]]; then
echo
echo 'ERROR:'
echo ' Xcode is too old.'
Expand Down Expand Up @@ -85,12 +87,8 @@ cp -R "src/apps/SettingsWindow/build/Release/Karabiner-Elements.app" "$basedir"
# Sign with Developer ID
#

set +e # allow command failure

bash scripts/codesign.sh "pkgroot"

set -e # forbid command failure

#
# Update file permissions
#
Expand Down Expand Up @@ -148,12 +146,8 @@ rm -f $archiveName/Karabiner-DriverKit-VirtualHIDDevice.pkg

echo "Sign with Developer ID"

set +e # allow command failure

bash scripts/codesign-pkg.sh $archiveName/$pkgName

set -e # forbid command failure

#
# Create dmg
#
Expand Down
6 changes: 6 additions & 0 deletions scripts/codesign-pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ readonly PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH

readonly CODE_SIGN_IDENTITY=$(bash $(dirname $0)/get-installer-codesign-identity.sh)

if [[ -z $CODE_SIGN_IDENTITY ]]; then
echo "Skip codesign"
exit 0
fi

readonly LOGFILE="$(dirname $0)/productsign.log"

err() {
Expand Down

0 comments on commit 6bc77eb

Please sign in to comment.