Created
September 25, 2015 04:08
-
-
Save VerachadW/c824c0d6780da8f6b116 to your computer and use it in GitHub Desktop.
Script for import drawable with 'ic_' prefix
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 | |
display_usage() { | |
echo "Usage: ./drawable_importer [src_path] [dest_path]" | |
} | |
if [ -z "$1" ]; then | |
echo "src path is not supplied" | |
display_usage | |
exit 1 | |
fi | |
if [ -z "$2" ]; then | |
echo "dest path is not supplied" | |
display_usage | |
exit 1 | |
fi | |
SRC=`greadlink -f "$1"` | |
DEST=`greadlink -f "$2"` | |
for i in "$SRC"/drawable-*; do | |
current_folder=`basename "$i"` | |
ls "$i" | xargs -I {} mv "$i"/{} "$DEST"/$current_folder/ic_{}; | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: You need to call
brew install coreutils
before using this script.