-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrefresh.sh
executable file
·63 lines (49 loc) · 1.54 KB
/
refresh.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
#!/bin/bash
# run this using Docker:
# docker run --rm -v$PWD:/mnt --workdir=/mnt node bash ./refresh.sh -k $LN_KEY
while getopts k:a: option
do
case "${option}"
in
k) btcPayKey=${OPTARG};; # the api key for the BtcPayServer
a) apps=${OPTARG};; # comma separated list of app IDs
esac
done
echo " * Installing node packages..."
npm install
echo " * Updating from Google and Apple $apps ..."
node \
--input-type=module \
--eval "import refreshApps from \"./refreshApps.mjs\"; refreshApps.refresh(false, \"$apps\")"
if [ -z "$apps" ]; then
echo " * Running script to generate app IDs..."
wait
apps=$(node scripts/defunctParser.js)
if [ -n "$apps" ]; then
node \
--input-type=module \
--eval "import refreshApps from \"./refreshApps.mjs\"; refreshApps.refresh(true, \"$apps\")"
fi
fi
echo " * Refreshing donations page from BTCPay..."
node refreshDonations.mjs $btcPayKey
wait
echo " * Update/resize images and icons..."
if [ "$( git diff --name-only | grep 'wIcons' )" != "" ]; then
./updateImages.sh
fi
echo " * Generating Twitter cards..."
node scripts/twitterCardGen.mjs
wait
echo " * Generating verdict pills..."
./scripts/pillGen.sh
wait
echo " * Calling refreshResults.sh..."
./refreshResults.sh
echo " * Generate allOpinions.json from Nostr..."
node ./scripts/compileAllOpinions.js
echo " * Updating attestations.json..."
node refreshAttestationsDB.mjs _android _desktop _hardware _iphone
echo
echo
echo "Done! I'm just a stupid bot! Please carefully review my changes before committing or publishing!"