Last active
January 27, 2022 15:39
-
-
Save bradhowes/8f86a61924536e2e27dc23bc9fe269d7 to your computer and use it in GitHub Desktop.
Simple script that is useful as a Build post-action to remove bogus embedded frameworks due to Swift packages.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
echo "-- BEGIN post-build.sh" | |
function process # TOP EMBED | |
{ | |
local TOP="${1}" EMBED="${2}" | |
cd "${CODESIGNING_FOLDER_PATH}/${TOP}" | |
ls -l | |
for DIR in *; do | |
BAD="${DIR}${EMBED}" | |
if [[ -d "${BAD}" ]]; then | |
echo "-- deleting '${BAD}'" | |
rm -rf "${BAD}" | |
fi | |
done | |
} | |
if [[ -d "${CODESIGNING_FOLDER_PATH}/Contents/Frameworks" ]]; then | |
# macOS paths | |
process "/Contents/Frameworks" "/Versions/A/Frameworks" | |
elif [[ -d "${CODESIGNING_FOLDER_PATH}/Frameworks" ]]; then | |
# iOS paths | |
process "/Frameworks" "/Frameworks" | |
fi | |
echo "-- END post-build.sh" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment