cleaned up bashisms

This commit is contained in:
Luxferre
2026-07-27 20:33:44 +03:00
parent 3c952b7631
commit 9775b3edc4
9 changed files with 46 additions and 46 deletions
+4 -4
View File
@@ -27,7 +27,7 @@ if [ "$PROV" = "gh" ]; then
LANG_URL=""
elif [ "$PROV" = "gl" ]; then
TGT="${temp#*gitlab.com/}"
ROOT_URL="https://gitlab.com/api/v4/projects/${TGT/\//%2F}"
ROOT_URL="https://gitlab.com/api/v4/projects/$(echo "$TGT" | sed 's/\//%2F/g')"
LANG_URL="${ROOT_URL}/languages"
elif [ "$PROV" = "cb" ]; then
TGT="${temp#*codeberg.org/}"
@@ -55,15 +55,15 @@ echo "$langdata" | grep -qi "$CHLANG" && CORR_SCORE=$((CORR_SCORE + 10))
# but if it is the main one, we further increase the score by 50
echo "$mainlang" | grep -qi "$CHLANG" && CORR_SCORE=$((CORR_SCORE + 50))
if ((CORR_SCORE >= 50)); then
if [ "$CORR_SCORE" -ge 50 ]; then
echo "The project $TGT is most likely written in $CHLANG."
if ((CORR_SCORE >= 100)); then
if [ "$CORR_SCORE" -ge 100 ]; then
echo 'The author is a definite fanatic of this language.'
fi
exit 0
else
echo "The project $TGT does not seem to be written in $CHLANG."
if ((CORR_SCORE > 0)); then
if [ "$CORR_SCORE" -gt 0 ]; then
echo 'However, this language may be partially used there.'
fi
exit 1;