-
Notifications
You must be signed in to change notification settings - Fork 70
/
Copy pathbuild-exe.mac.sh
executable file
·55 lines (44 loc) · 1.12 KB
/
build-exe.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
#! /bin/bash
# vi: ts=4 sw=4 et syntax=sh :
cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
NAME='import-mailbox-to-gmail'
BUILD_DIR="./build"
_uname="$(uname)"
case "${_uname}" in
[dD]arwin)
;;
*)
die "OS not supported: ${_uname}"
;;
esac
TOOL_pyinstaller="$(which pyinstaller 2>/dev/null)"
TOOL_pyi_makespec="$(which pyi-makespec 2>/dev/null)"
if [[ -z "${TOOL_pyinstaller}" || -z "${TOOL_pyi_makespec}" ]]; then
echo "Missing required tool: pyinstaller" >&2
exit 1
fi
python2 \
"${TOOL_pyi_makespec}" \
--name "${NAME}" \
--specpath "${BUILD_DIR}" \
--console \
--osx-bundle-identifier "${NAME}" \
--onefile \
import-mailbox-to-gmail.py
_exit_code="$?"
if [[ "${_exit_code}" -ne 0 ]]; then
echo "Spec file generation failed" >&2
exit ${_exit_code}
fi
python2 \
"${TOOL_pyinstaller}" \
--noconfirm \
--clean \
--workpath "${BUILD_DIR}" \
--distpath="${BUILD_DIR}/exe/macos" \
"${BUILD_DIR}/${NAME}.spec"
_exit_code="$?"
if [[ "${_exit_code}" -ne 0 ]]; then
echo "Pyinstaller invocation failed" >&2
exit ${_exit_code}
fi