-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathgenREADME.sh
More file actions
executable file
·32 lines (25 loc) · 1.12 KB
/
genREADME.sh
File metadata and controls
executable file
·32 lines (25 loc) · 1.12 KB
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
#!/usr/bin/env bash
cat<< EOF
This repository contains the sources of the following [webextensions](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions)
Feel free to take or use them however you like.
EOF
echo ""
echo "| Src | Description | AMO |"
echo "| ---: | --- | --- |"
if [ -d ./sources ];then
for x in ./sources/*;do
if [ -f "$x/manifest.json" ]; then
EXTID=$(basename "$x")
DESC=$(jq -r '.description // ""' "$x/manifest.json" 2>/dev/null)
AMOLURL="https://addons.mozilla.org/firefox/addon/$EXTID"
CODE=$(curl -sL -I "$AMOLURL" -w "%{http_code}" -o /dev/null)
if [ $CODE -eq 200 ];then
MDEXTID=$(echo -n "$EXTID" | sed 's/-/\ /g')
echo "| [$MDEXTID](https://github.com/igorlogius/webextensions/tree/main/sources/$EXTID) | $DESC | [link](https://addons.mozilla.org/firefox/addon/$EXTID) |"
#else
# echo "| [$TMPEXTID](https://github.com/igorlogius/webextensions/tree/main/sources/$EXTID) | $DESC | |"
fi
fi
done | sort -t'|' -k1,1
fi
echo ""