-
Notifications
You must be signed in to change notification settings - Fork 0
/
dist_mac.sh
executable file
·67 lines (50 loc) · 1.75 KB
/
dist_mac.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
APPNAME="Resourcer";
VERSION=$(cat VERSION)
DISTNAME="${APPNAME}-v${VERSION}"
DIST_DIR="build/${DISTNAME}"
CONTENTS="${DIST_DIR}/${APPNAME}.app/Contents";
MACOS="${CONTENTS}/MacOS"
RESOURCES="${CONTENTS}/Resources"
RESOURCER="${MACOS}/rsc/"
# Remove build dir if needed
if [ -d "build/" ]; then
rm -r "build/"
fi;
# Create .app directory tree
mkdir -p "${CONTENTS}";
mkdir -p "${MACOS}";
mkdir -p "${RESOURCES}";
mkdir -p "${MACOS}/ui";
mkdir -p "${MACOS}/share";
mkdir -p "${RESOURCER}";
cp share/Info.plist "${CONTENTS}";
# Copy the bash script that will serve as the entry point of the app
cp share/run_dist.sh "${MACOS}/${APPNAME}";
chmod +x "${MACOS}/${APPNAME}";
# Create resources for the app
cp share/group-512.png.icns "${RESOURCES}";
# ui files
cp ui/mainwindow.ui "${MACOS}/ui";
# client secret
cp share/CLIENTSECRET.json "${MACOS}/share";
# Version
cp VERSION "${MACOS}";
# Create the main files for the app
cd resourcer
cp resourcer.py "../${RESOURCER}";
# chmod +x "../${RESOURCER}/resourcer.py";
cp bigquery.py "../${RESOURCER}";
cp countries.py "../${RESOURCER}";
cp queries.py "../${RESOURCER}";
cp resourcer.py "../${RESOURCER}";
cp srcdplayground.py "../${RESOURCER}";
cp srcdrest.py "../${RESOURCER}";
cd ..
cp share/install-update-resourcer.sh ${DIST_DIR}
# zip package to be distributes
cd "build"; zip -r "${DISTNAME}.zip" "${DISTNAME}" > /dev/null 2>&1; cd ..
echo "Successfully builded"
echo "To install the program put ${DISTNAME}.zip in ~/Downloads and execute the following command in a console:"
echo ""
echo "unzip ~/Downloads/${DISTNAME}.zip -d ~/Downloads > /dev/null 2>&1 && bash ~/Downloads/${DISTNAME}/install-update-resourcer.sh && rm -r ~/Downloads/${DISTNAME} && echo \"${DISTNAME} was succesfully installed\""