Created
November 12, 2016 23:38
-
-
Save ntkachov/3de9782df7f8404d88158501f1096495 to your computer and use it in GitHub Desktop.
Download icons from material library
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 | |
color=black | |
dp=48 | |
fileArray=() | |
while test $# != 0 | |
do | |
case "$1" in | |
-w) color=white;; | |
-b) color=black;; | |
-dp18|-dp1) dp=18;; | |
-dp24|-dp2) dp=24;; | |
-dp36|-dp3) dp=36;; | |
-dp48|-dp4) dp=48;; | |
*)fileArray+=($1);; | |
esac | |
shift | |
done | |
for f in ${fileArray[@]}; do | |
file=ic_ | |
file+=$f | |
file+=_ | |
file+=$color | |
file+=_ | |
file+=$dp | |
file+=dp | |
curl -s -O https://storage.googleapis.com/material-icons/external-assets/v4/icons/zip/$file.zip > /dev/null | |
unzip $file.zip > /dev/null | |
cd $file | |
rm -rf ios | |
rm -rf web | |
mv -v android/* . > /dev/null | |
rm -rf android > /dev/null | |
for dir in */; do | |
echo $dir | |
if [ ! -e ../$dir ] | |
then | |
mkdir -p ../MaterialIcons/$dir | |
fi | |
mv -v $dir/* ../MaterialIcons/$dir | |
done | |
cd .. | |
rm -rf $file | |
rm $file.zip | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment