Skip to content

Instantly share code, notes, and snippets.

@lanserxt
Created November 13, 2024 12:19
Show Gist options
  • Save lanserxt/50c54a459f0962dfaf6bf89c392875d5 to your computer and use it in GitHub Desktop.
Save lanserxt/50c54a459f0962dfaf6bf89c392875d5 to your computer and use it in GitHub Desktop.
Remove token from plist
# 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