-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·50 lines (44 loc) · 1.43 KB
/
build.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# brew install create-dmg to use this.
# make sure all pre-req files are in assets/ in working directory
# checking pre-req files
if [[ ! -f "assets/AppIcon.icns" ]]
then
echo "assets/AppIcon.icns (used as icon for app) not in current directory. Exiting..."
exit 1
elif [[ ! -f "assets/cup_10_pt.svg" ]]
then
echo "assets/cup_10_pt.svg (used as menubar icon) does not exist in current directory. Exiting..."
exit 1
elif [[ ! -f "assets/installer_background.png" ]]
then
echo "assets/installer_background.png (used as background for dmg installer window) not in current directory. Exiting..."
exit 1
elif [[ ! -f "clippy.py" ]]
then
echo "clippy.py (main python script for app) not in current directory. Exiting..."
exit 1
fi
INSTALLER_NAME="Clippy-Installer"
# clean old dmgs and cache
test -f "$INSTALLER_NAME".dmg && rm "$INSTALLER_NAME".dmg
test -e cache && rm -rf cache
# create .app file
echo "creating app file..."
python3 setup.py py2app
echo "App file commands finished (check for errors above!). Sleeping for 1 second..."
sleep 1
# create disk image
echo "Creating dmg..."
create-dmg \
--volname "Clippy Installer" \
--volicon "assets/AppIcon.icns" \
--background "assets/installer_background.png" \
--window-pos 200 120 \
--window-size 636 400 \
--icon-size 100 \
--icon "Clippy.app" 163 210 \
--hide-extension "Clippy.app" \
--app-drop-link 494 203 \
"$INSTALLER_NAME.dmg" \
"dist/"