-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·36 lines (31 loc) · 1.33 KB
/
build.sh
File metadata and controls
executable file
·36 lines (31 loc) · 1.33 KB
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
36
#!/bin/bash
ARGS="$*"
if [ -z "$ARGS" ]; then
echo "Usage: ./build.sh [--win] [--linux] [--mac] [--universal]"
exit 1
fi
mkdir -p build
cp inject.css build/inject.css
curl -fsSL "https://app.webmc.xyz/assets/img/webmc.png" -o "./build/icon.png"
if [[ $? -ne 0 ]]; then
echo "Failed to download icon."
exit 1
fi
if command -v convert &> /dev/null; then
convert build/icon.png -define icon:auto-resize=256,128,64,48,32,16 build/icon.ico
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
mkdir -p build/icon.iconset
sips -z 16 16 build/icon.png --out build/icon.iconset/icon_16x16.png
sips -z 32 32 build/icon.png --out build/icon.iconset/icon_16x16@2x.png
sips -z 32 32 build/icon.png --out build/icon.iconset/icon_32x32.png
sips -z 64 64 build/icon.png --out build/icon.iconset/icon_32x32@2x.png
sips -z 128 128 build/icon.png --out build/icon.iconset/icon_128x128.png
sips -z 256 256 build/icon.png --out build/icon.iconset/icon_128x128@2x.png
sips -z 256 256 build/icon.png --out build/icon.iconset/icon_256x256.png
sips -z 512 512 build/icon.png --out build/icon.iconset/icon_256x256@2x.png
sips -z 512 512 build/icon.png --out build/icon.iconset/icon_512x512.png
cp build/icon.png build/icon.iconset/icon_512x512@2x.png
iconutil -c icns build/icon.iconset -o build/icon.icns
fi
npx electron-builder $ARGS