-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmkicns.sh
executable file
·35 lines (33 loc) · 1.85 KB
/
mkicns.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
INAME="${1##*/}"
VER="${INAME##* }"
NAME="${INAME##*-}"
NAME="${NAME% *}"
DIRC="temp/$NAME.app/Contents"
DIRA="temp/$NAME.app"
mkdir -p temp
mkdir -p "$DIRC/Resources/icon.iconset"
convert "$1/game.ico" -resize 16x16 "$DIRC/Resources/icon.iconset/icon_16x16.png"
convert "$1/game.ico" -resize 32x32 "$DIRC/Resources/icon.iconset/icon_16x16@2x.png"
convert "$1/game.ico" -resize 32x32 "$DIRC/Resources/icon.iconset/icon_32x32.png"
convert "$1/game.ico" -interpolate Nearest -filter point -resize 64x64 "$DIRC/Resources/icon.iconset/icon_32x32@2x.png"
convert "$1/game.ico" -interpolate Nearest -filter point -resize 128x128 "$DIRC/Resources/icon.iconset/icon_128x128.png"
convert "$1/game.ico" -interpolate Nearest -filter point -resize 256x256 "$DIRC/Resources/icon.iconset/icon_128x128@2x.png"
convert "$1/game.ico" -interpolate Nearest -filter point -resize 256x256 "$DIRC/Resources/icon.iconset/icon_256x256.png"
convert "$1/game.ico" -interpolate Nearest -filter point -resize 512x512 "$DIRC/Resources/icon.iconset/icon_256x256@2x.png"
convert "$1/game.ico" -interpolate Nearest -filter point -resize 512x512 "$DIRC/Resources/icon.iconset/icon_512x512.png"
convert "$1/game.ico" -interpolate Nearest -filter point -resize 1024x1024 "$DIRC/Resources/icon.iconset/icon_512x512@2x.png"
iconutil -c icns "$DIRC/Resources/icon.iconset"
rm -R "$DIRC/Resources/icon.iconset"
cp Info.plist "$DIRC"
sed -i '' "s/%%%TEMPLATEBUNDLENAME%%%/$NAME/" "$DIRC/Info.plist"
sed -i '' "s/%%%TEMPLATEBUNDLEVERSION%%%/$VER/" "$DIRC/Info.plist"
mkdir "$DIRC/MacOS/"
cp -R "$1" "$DIRC/MacOS/game"
cp easyrpg-setup "$DIRC/MacOS/"
sed -i '' "s/%%%TEMPLATEBUNDLENAME%%%/$NAME/g" "$DIRC/MacOS/easyrpg-setup"
cp "$(which easyrpg-player)" "$DIRC/MacOS"
hdiutil create -volname "$NAME" -srcfolder temp -format UDBZ "$INAME.dmg"
tar -C temp -cjf "$INAME.tar.bz2" "$NAME.app"
rm -R temp
echo "$INAME done"