Created
November 13, 2024 12:19
-
-
Save lanserxt/50c54a459f0962dfaf6bf89c392875d5 to your computer and use it in GitHub Desktop.
Remove token from plist
This file contains hidden or 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
# Define the relative path to the file containing the access token | |
TOKEN_FILE_PATH="${SRCROOT}/Config/access_token.txt" | |
# Check if the file exists | |
if [ -f "$TOKEN_FILE_PATH" ]; then | |
# Read the access token from the file | |
ACCESS_TOKEN=$(cat "$TOKEN_FILE_PATH") | |
else | |
echo "Access token file not found at $TOKEN_FILE_PATH" | |
exit 1 | |
fi | |
# Define the path to the Info.plist file | |
PLIST_PATH="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" | |
# Use PlistBuddy to set the SOME_IMPORTANT_TOKEN in the Info.plist file | |
/usr/libexec/PlistBuddy -c "Set :SOME_IMPORTANT_TOKEN $ACCESS_TOKEN" "$PLIST_PATH" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment