CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
ProdigyPNP

CoCalc is a real-time collaborative commercial alternative to JupyterHub and Overleaf that provides Jupyter Notebooks, LaTeX documents, and SageMath.

GitHub Repository: ProdigyPNP/ProdigyMathGameHacking
Path: blob/master/PHEx/build.sh
Views: 713
1
# PHEx Build Script
2
3
# Prefix
4
PREFIX="[PHEx Builder] "
5
6
echo ""
7
8
# echo with prefix
9
xlog () {
10
echo "$PREFIX$1"
11
}
12
13
# exit with message
14
ext () {
15
echo "$1"
16
exit 0
17
}
18
19
20
21
22
# Delete build/extension.zip
23
xlog "Deleting extension.zip..."
24
rm build/extension.zip && xlog "Deleted extension.zip" || xlog "No extension.zip found"
25
26
27
# Delete build/extension.xpi
28
xlog "Deleting extension.xpi..."
29
rm build/extension.xpi && xlog "Deleted extension.xpi" || xlog "No extension.xpi found"
30
echo ""
31
32
33
34
35
# Tell the user that the chromium extension is being zipped
36
xlog "Zipping chromium extension..."
37
38
# Go into ./src/
39
cd ./src/
40
41
# Zip ./src/ to ./build.extension.zip
42
zip -q -r ../build/extension.zip ./ && xlog ".ZIP chromium extension built -> extension.zip"
43
44
# Tell the user that we've build the chromium extension successfully.
45
xlog "Chromium extension Success!" && echo ""
46
47
48
49
50
51
52
# Go out of ./src/ and into ./firefox/
53
cd ../firefox/
54
55
# Zip ./firefox/ to ./build.extension.xpi
56
zip -q -r ../build/extension.xpi ./ && xlog ".XPI file built -> extension.xpi"
57
58
59
# Tell the user that we've build the firefox extension successfully.
60
xlog "Firefox extension Success!" && echo ""
61
62
63
64
65
# When making .crx extensions, it needs to be signed with a private key file to work.
66
# Tell the user that extension.crx needs to be signed if it's a production-used release.
67
echo "\033[0;31m" && xlog "IMPORTANT: IF YOU ARE MAKING AN OFFICIAL PHEx RELEASE, THEN PLEASE REMEMBER TO SIGN THE .CRX WITH A PRIVATE KEY FILE." && echo ""
68
69
# Tell the user that we're done.
70
echo "\033[0m" && xlog "Done!"
71