This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
generated from ChewKeanHo/AutomataCI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cmd
executable file
·105 lines (90 loc) · 2.76 KB
/
build.cmd
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
echo >/dev/null # >nul & GOTO WINDOWS & rem ^
# LICENSE CLAUSES HERE
# --------------------
# Leave the echo instruction above as first line as it is the trigger for
# jumping for Windows OS.
#
################################################################################
# Unix Main Codes #
################################################################################
if [ "$BASH_SOURCE" == "$(command -v $0)" ]; then
printf "[ ERROR ] - Source me instead! -> $ . ./setup.cmd\n"
exit 1
fi
. ./start.cmd
if [ "$(type -p pyinstaller)" == "" ]; then
printf "[ ERROR ] - missing pyinstaller. Source setup.cmd first. -> $ . ./setup.cmd\n"
exit 1
fi
os="$(uname)"
os="${os,,}"
case "$os" in
windows*|ms-dos*)
os='windows'
;;
cygwin*|mingw*|mingw32*|msys*)
os='windows'
;;
*freebsd)
os='freebsd'
;;
dragonfly*)
os='dragonfly'
;;
*)
;;
esac
arch="$(uname -m)"
arch="${arch,,}"
case "$arch" in
i686-64)
arch='ia64'
;;
i386|i486|i586|i686)
arch='i386'
;;
x86_64)
arch='amd64'
;;
sun4u)
arch='sparc'
;;
"power macintosh")
arch='powerpc'
;;
ip*)
arch='mips'
;;
*)
;;
esac
read -rd '' name <src/NAME || :
name="${name:-main}_${os}-${arch}"
pyinstaller --noconfirm \
--onefile \
--clean \
--distpath './bin' \
--workpath './tmp' \
--specpath './src' \
--name "$name" \
'src/main.py'
################################################################################
# Unix Main Codes #
################################################################################
return
:WINDOWS
::##############################################################################
:: Windows Main Codes #
::##############################################################################
start.cmd
pyinstaller --noconfirm ^
--onefile ^
--clean ^
--distpath './bin' ^
--workpath './tmp' ^
--specpath './src' ^
'src/main.py'
::##############################################################################
:: Windows Main Codes #
::##############################################################################
EXIT /B