Skip to content

Instantly share code, notes, and snippets.

@iburlakov
Created April 18, 2016 09:36
Show Gist options
  • Save iburlakov/f55f79a29fb85275d8f51849be6c187d to your computer and use it in GitHub Desktop.
Save iburlakov/f55f79a29fb85275d8f51849be6c187d to your computer and use it in GitHub Desktop.
Batch convert icns/iconset
#!/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