Last active
March 6, 2019 13:25
-
-
Save schmidt9/7e4f97400d1514a83293a11ae54c51b7 to your computer and use it in GitHub Desktop.
Rename iOS splash screen files
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/sh | |
echo "path: $1" | |
#check number of args | |
if [ $# = 0 ]; then | |
echo "No path to images directory" | |
exit 1 | |
fi | |
for filename in "$1"/*.png; do | |
echo "file: $filename" | |
pixelWidth=$(sips -g pixelWidth "$filename" | awk '/pixelWidth:/{print $2}') | |
pixelHeight=$(sips -g pixelHeight "$filename" | awk '/pixelHeight:/{print $2}') | |
echo "size: $pixelWidth x $pixelHeight" | |
if [[ $pixelWidth = 640 && $pixelHeight = 960 ]]; then | |
cp "$filename" "$1/[email protected]" | |
elif [[ $pixelWidth = 640 && $pixelHeight = 1136 ]]; then | |
cp "$filename" "$1/[email protected]" | |
elif [[ $pixelWidth = 828 && $pixelHeight = 1792 ]]; then | |
cp "$filename" "$1/[email protected]" | |
elif [[ $pixelWidth = 1125 && $pixelHeight = 2436 ]]; then | |
cp "$filename" "$1/[email protected]" | |
elif [[ $pixelWidth = 1242 && $pixelHeight = 2208 ]]; then | |
cp "$filename" "$1/[email protected]" | |
elif [[ $pixelWidth = 1242 && $pixelHeight = 2688 ]]; then | |
cp "$filename" "$1/[email protected]" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment