Created
August 12, 2016 11:47
-
-
Save int02h/d0a0d3af866d8605bbc60800a9a7372b to your computer and use it in GitHub Desktop.
Remove Android resource string from all strings.xml
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/sh | |
help() { | |
echo "Usage: ./delete-string.sh PATH_TO_RES_FOLDER STRING_NAME" | |
echo "Where:" | |
echo " PATH_TO_RES_FOLDER - path to project resource directory" | |
echo " STRING_NAME - string name" | |
echo "" | |
} | |
if [ $# != 2 ] | |
then | |
echo "Not enough arguments\n" | |
help | |
exit 1 | |
fi | |
RES_PATH=$1 | |
STRING_NAME=$2 | |
FILES=$(find $RES_PATH -name strings.xml) | |
for f in $FILES; do | |
echo "Removing '$2' string from '$f' - \c" | |
sed -i "" "/name=\"$STRING_NAME\"/d" "$f" | |
echo "Done" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Tested on OS X El Capitan