Last active
January 8, 2018 10:13
-
-
Save bonnyfone/32d18d1f4cb1d6292943d545d63af32c to your computer and use it in GitHub Desktop.
Simple bash script which automatically generates locales resConfigs snippet from your project's res/ directory
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 | |
GREEN='\033[0;32m' | |
NC='\033[0m' | |
printf "Generating resConfig from resource dir: $1\n" | |
resconfig="resConfigs" | |
for values in `ls $1 | grep values-`; do | |
log="Inspecting $values" | |
if [ -f "$1/$values/strings.xml" ] | |
then | |
suffix=`echo $values | sed 's/values-//g'` | |
log="$log ${GREEN}(FOUND)${NC}" | |
resconfig="$resconfig \"$suffix\"," | |
fi | |
echo -e $log | |
done | |
resconfig="${resconfig::-1}" | |
printf "\nAdd the following resConfigs in your build.gradle:\n\n\t ${GREEN}$resconfig${NC}\n\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment