Skip to content

Instantly share code, notes, and snippets.

@VerachadW
Created September 25, 2015 04:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VerachadW/c824c0d6780da8f6b116 to your computer and use it in GitHub Desktop.
Save VerachadW/c824c0d6780da8f6b116 to your computer and use it in GitHub Desktop.
Script for import drawable with 'ic_' prefix
#!/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;
@VerachadW
Copy link
Author

NOTE: You need to call brew install coreutils before using this script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment