-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.sh
executable file
·83 lines (61 loc) · 1.79 KB
/
package.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
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
#!/bin/bash
set -e
if [[ -d ./src/ ]]; then
:
elif [[ -d ./linux/ && -d ./windows/ ]]; then
cd ..
else
echo "[!] Working directory must be in the root direcotry or in the packaging directory!"
exit
fi
VERPATH="./version"
version="$1"
clean() {
echo "[!] Cleaning the repo directory"
echo "[+] Removing output folders"
while IFS= read -r line; do
echo "[log] Deleting ./out/$line"
sudo rm -rf "./out/$line"
done < "./out/.gitignore"
echo "[log] Removing windows packaging outputs"
rm -rf ./packaging/windows/offline/Output
rm -rf ./packaging/windows/web/Output
echo "[+] Finished cleaning packaging direcotry"
}
if [[ "$version" == "clean" ]]; then
clean
exit
fi
if [[ "$version" != "" ]]; then
echo "$version" > "$VERPATH"
echo "Setting version: $version"
else
version="$(cat "$VERPATH")"
echo "Using version: $version"
fi
echo "[log] Compiling for linux"
cd ./building/linux/
./build.sh
cd ../../
echo "[+] Finished compiling for linux"
echo "[log] Packaging deb"
cp ./out/linux-out/main.bin ./packaging/linux/JK_PasswordManager/usr/share/jkpm-inst/jkpm
cd ./packaging/linux
./package.sh
cd ../../
echo "[+] Finished packaging deb"
echo "[log] Building windows web installer"
cd ./packaging/windows
./package-web.sh
cd ../../
echo "[+] Finished building web installer for windows"
if [[ -f ./out/windows-out/JK_PasswordManager.exe ]]; then
echo "[log] Packaging windows offline installer since windows executable is present"
cd ./packaging/windows
./package-offline.sh
cd ../../
echo "[+] Finished building windows offline installer"
else
echo "[-] Skiping building offline windows installer since executable is not present"
fi
# TODO: contenerize compiling for windows (if "practically" possible)