Created
April 18, 2016 09:36
-
-
Save iburlakov/f55f79a29fb85275d8f51849be6c187d to your computer and use it in GitHub Desktop.
Batch convert icns/iconset
This file contains hidden or 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 | |
DIR=$1 | |
FORMAT=$2 | |
FILES=$DIR/* | |
for file in $FILES | |
do | |
filename="${file##*/}" | |
name="${filename%.*}" | |
if [ "$FORMAT" == "iconset" ]; then | |
iconutil -c iconset -o $DIR/$name.iconset $DIR/$name.icns | |
elif [ "$FORMAT" == "icns" ]; then | |
iconutil -c icns -o $DIR/$name.icns $DIR/$name.iconset | |
else | |
echo "Invalid format $FORMAT" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment