forked from createcandle/voco
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.sh
More file actions
executable file
·54 lines (41 loc) · 1.17 KB
/
package.sh
File metadata and controls
executable file
·54 lines (41 loc) · 1.17 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
#!/bin/bash
set -e
version=$(grep version package.json | cut -d: -f2 | cut -d\" -f2)
# Remove the injections
if [ -d "snips/work/injections" ]
then
echo "removing injections folder"
rm -rf snips/work/injections
fi
# Clean up from previous releases
rm -rf *.tgz package
rm -f SHA256SUMS
rm -rf lib
# Make sure files exist and are initially empty
if [ -e snips/playme.wav ]
then
rm -f snips/playme.wav
fi
if [ -e snips.tar ]
then
echo "removing old snips.tar file"
rm -f snips.tar
fi
tar -cvzf snips.tar snips/
# Put package together
mkdir package
mkdir lib
# Pull down Python dependencies
pip3 install -r requirements.txt -t lib --no-binary fuzzywuzzy,python-dateutil,pytz,paho-mqtt,requests --prefix ""
cp -r pkg lib snips.tar sounds LICENSE package.json *.py package/
find package -type f -name '*.pyc' -delete
find package -type d -empty -delete
# Generate checksums
cd package
#sha256sum *.py snips.tar pkg/*.py sounds/*.wav LICENSE > SHA256SUMS
find . -type f \! -name SHA256SUMS -exec sha256sum {} \; >> SHA256SUMS
cd -
# Make the tarball
tar czf "voco-${version}.tgz" package
sha256sum "voco-${version}.tgz"
#sudo systemctl restart mozilla-iot-gateway.service