Skip to content

Commit 4be1fd0

Browse files
authored
Merge pull request #61 from ivan-hc/main
Keep extra icons / improve automatic URL detection from scripts
2 parents f49e6e8 + 5c5748c commit 4be1fd0

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

.github/workflows/sync-with-AM.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ jobs:
3535
if [ -n "$AMD64_LIST" ] && echo "$AMD64_LIST" 2>/dev/null | grep -q "^◆ "; then
3636
3737
MDS=$(ls apps/* | sed 's:.*/::; s/.md$//g')
38-
PNGS=$(ls icons/* | sed 's:.*/::; s/.png$//g')
3938
for m in $MDS; do
4039
if ! echo "$AMD64_LIST" 2>/dev/null | grep -q "◆ $m :"; then
4140
rm -f "apps/$m.md"
4241
echo "Removed apps/$m.md"
4342
fi
4443
done
4544
46-
for p in $PNGS; do
47-
if ! echo "$AMD64_LIST" 2>/dev/null | grep -q "◆ $p :"; then
48-
rm -f "icons/$p.png"
49-
echo "Removed icons/$p.png"
50-
fi
51-
done
45+
#PNGS=$(ls icons/* | sed 's:.*/::; s/.png$//g')
46+
#for p in $PNGS; do
47+
# if ! echo "$AMD64_LIST" 2>/dev/null | grep -q "◆ $p :"; then
48+
# rm -f "icons/$p.png"
49+
# echo "Removed icons/$p.png"
50+
# fi
51+
#done
5252
5353
fi
5454
@@ -67,7 +67,13 @@ jobs:
6767
6868
if echo "$INSTALLATION_SCRIPT" 2>/dev/null | grep -q "^SITE="; then
6969
site_ref=$(echo "$INSTALLATION_SCRIPT" 2>/dev/null | grep "^SITE=" | head -1 | awk -F'"' '$0=$2')
70-
if echo "$INSTALLATION_SCRIPT" 2>/dev/null | grep -q "^version=.*curl .*codeberg.org"; then
70+
if [ -z "$site_ref" ]; then
71+
if echo "$INSTALLATION_SCRIPT" 2>/dev/null | grep -q "^version=.*curl .*api.github.com"; then
72+
SITE=$(echo "$INSTALLATION_SCRIPT" 2>/dev/null | grep "^version" | grep -Eo "(http|https)://[a-zA-Z0-9./?=_%:-]*" | head -1 | sed 's#//api.#//#g; s#/repos/#/#g; s#/releases.*##')
73+
else
74+
SITE=$(echo "$INSTALLATION_SCRIPT" 2>/dev/null | grep "^version" | grep -Eo "(http|https)://[a-zA-Z0-9.?=_%:-]*" | head -1)
75+
fi
76+
elif echo "$INSTALLATION_SCRIPT" 2>/dev/null | grep -q "^version=.*curl .*codeberg.org"; then
7177
SITE="https://codeberg.org/$site_ref"
7278
elif echo "$INSTALLATION_SCRIPT" 2>/dev/null | grep -q "^version=.*curl .*api.github.com" || ! echo "$site_ref" 2>/dev/null | grep -q "^http://\|^https://\|^ftp://"; then
7379
SITE="https://github.com/$site_ref"

0 commit comments

Comments
 (0)