forked from arne-fuchs/edcas-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate-linux-release.sh
executable file
·49 lines (37 loc) · 1.22 KB
/
create-linux-release.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
#!/bin/bash
echo "Running cargo commands"
#cargo clean
cargo build --release
folder_name="edcas-client"
if [ -d "$folder_name" ]; then
echo "Folder '$folder_name' found. Removing..."
# Remove the folder
rm -rf "$folder_name"
echo "Folder removed."
fi
echo "Creating folders"
mkdir "$folder_name"
mkdir "$folder_name"/logs
echo "Copying files"
cp -r graphics "$folder_name"/
cp settings-example.json "$folder_name"/settings-example.json
cp settings-example.json "$folder_name"/settings.json
cp materials.json "$folder_name"/materials.json
cp target/release/edcas-client "$folder_name"/
echo "Compressing files"
tar czf edcas-client-linux.tar.gz "$folder_name"
rm -rf "$folder_name"
mkdir "$folder_name"
mkdir "$folder_name"/etc
mkdir "$folder_name"/etc/"$folder_name"
cp settings-example.json "$folder_name"/etc/"$folder_name"/settings-example.json
mkdir "$folder_name"/usr
mkdir "$folder_name"/usr/bin
cp target/release/edcas-client "$folder_name"/usr/bin
mkdir "$folder_name"/usr/share
mkdir "$folder_name"/usr/share/"$folder_name"
cp materials.json "$folder_name"/usr/share/"$folder_name"/materials.json
mkdir "$folder_name"/DEBIAN
cp control "$folder_name"/DEBIAN/
dpkg-deb --build edcas-client
rm -rf "$folder_name"