1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh -e # # Helper script for the build process to apply entitlements SRC="$1" DST="$2" ENTITLEMENT="$3" trap 'rm "$DST.tmp"' exit cp -af "$SRC" "$DST.tmp" codesign --entitlements "$ENTITLEMENT" --force -s - "$DST.tmp" mv "$DST.tmp" "$DST" trap '' exit