-
Notifications
You must be signed in to change notification settings - Fork 4
/
webpack-cp.sh
executable file
·58 lines (46 loc) · 1.8 KB
/
webpack-cp.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
#!/bin/bash
# Launch this script by typing /bin/bash webpack-cp.sh
#
# or with rexcutable permission: ./webpack-cp.sh
#
# modify permission by typing chmod a+x webpack-cp.sh
#
# perform webpack on the nine .js files:
#
# ./lib/iob/index.js
# ./lib/meal/index.js
# ./lib/determine-basal/determine-basal.js
# ./lib/glucose-get-last.js
# ./lib/basal-set-temp.js
# ./lib/determine-basal/autosens.js
# ./lib/profile/index.js
# ./lib/autotune-prep/index.js
# ./lib/autotune/index.js
npx webpack
#
# --- Copy and rename oref0/dist .js files to FreeAPS/Resources/javascript/bundle ---
#
# change directory variables as needed:
oref0DIR=./
apsDIR=../Trio
bundleDIR=$apsDIR/FreeAPS/Resources/javascript/bundle
cp -p -v $oref0DIR/dist/bundle/*.js $bundleDIR/
echo ""
echo "copying /lib/ source files to Trio/trio-oref"
echo ""
echo ""
cp -p -R $oref0DIR/lib $apsDIR/trio-oref/
echo "These source files are copied from https://github.com/nightscout/trio-oref, and are for information purposes only." > $apsDIR/trio-oref/oref_source_file_info.txt
echo "The algorithm is run based on minimised files in FreeAPS/Resources/javascript/bundle." >> $apsDIR/trio-oref/oref_source_file_info.txt
# Retrieves version, branch, and tag information from Git
git_version=$(git log -1 --format="%h" --abbrev=7)
git_branch=$(git symbolic-ref --short -q HEAD)
git_tag=$(git describe --tags --exact-match 2>/dev/null)
# Determines branch or tag information
git_branch_or_tag="${git_branch:-${git_tag}}"
git_branch_or_tag_version="${git_branch_or_tag} - git version: ${git_version}"
echo "oref0 branch: ${git_branch_or_tag_version}" > $apsDIR/oref0_source_version.txt
echo "" >> $apsDIR/oref0_source_version.txt
echo "Last commits:" >> $apsDIR/oref0_source_version.txt
git log --since=2024-01-01 --oneline --abbrev=7 >> $apsDIR/oref0_source_version.txt
exit