Created
May 5, 2016 17:20
-
-
Save davidortinau/e127aea1f287ba99478896fd58189e0c to your computer and use it in GitHub Desktop.
Shell script to take Android assets exported from Sketch and sort them into resource folders. Adapted from https://medium.com/@lmindler/using-sketch-3-and-a-bit-of-fairy-dust-for-a-better-android-workflow-f667d0048855#.r8qyblpe7.
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
mkdir drawable-xxhdpi; mkdir drawable-xhdpi; mkdir drawable-hdpi; mkdir drawable-mdpi | |
for file in $(find . -type f -iname '*-xxhdpi*'); do | |
mv "$file" "drawable-xxhdpi/${file/-xxhdpi/}" | |
done | |
for file in $(find . -type f -iname '*-xhdpi*'); do | |
mv "$file" "drawable-xhdpi/${file/-xhdpi/}" | |
done | |
for file in $(find . -type f -iname '*-hdpi*'); do | |
mv "$file" "drawable-hdpi/${file/-hdpi/}" | |
done | |
for file in $(find . -type f -iname '*-mdpi*'); do | |
mv "$file" "drawable-mdpi/${file/-mdpi/}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To make the shell script executable:
sudo chmod +x SortDroidAssets.sh
I add the file to my PATH so I can use it anywhere.