-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.sh
More file actions
executable file
·74 lines (66 loc) · 1.14 KB
/
Copy pathpackage.sh
File metadata and controls
executable file
·74 lines (66 loc) · 1.14 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
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
set -e
# Clean
clean() {
rm -rf build/*
mkdir -p build
}
# Build
build() {
yarn build
}
# Copy .env
copyEnv() {
cp .env ./build/.env
echo "\nEXECUTION_TYPE=EXECUTABLE" >> ./build/.env
}
# Copy Node modules
copyNodeModules() {
cp -r node_modules ./build/
}
# Package node
packageNode() {
nexe dist/cli/index.js -o ./build/${CLI_FILENAME} --target=${TARGET}
nexe dist/custom.js -o ./build/${CUSTOM_CLI_FILENAME} --target=${TARGET}
}
# Package python
packagePython() {
cd python-cli
${PYTHON_COMMAND} setup.py build
cd ../
cp -r ./python-cli/dist ./build/python-cli
}
packageAll() {
clean
build
packageNode
packagePython
copyEnv
copyNodeModules
}
case $1 in
linux)
TARGET=linux-x64-14.15.3
PYTHON_COMMAND=python3
CLI_FILENAME=cli
CUSTOM_CLI_FILENAME=custom
packageAll
;;
win)
TARGET=windows-x64-14.15.3
PYTHON_COMMAND=python
CLI_FILENAME=cli.exe
CUSTOM_CLI_FILENAME=custom.exe
packageAll
;;
mac)
TARGET=mac-x64-14.15.3
PYTHON_COMMAND=python3
CLI_FILENAME=cli
CUSTOM_CLI_FILENAME=custom
packageAll
;;
*)
echo "Invalid command"
exit 1
;;
esac