feat install.sh: move github/gitlab weburl detection into case statement

This commit is contained in:
prplwtf 2024-09-22 17:42:35 +02:00
parent a634196bf7
commit abf35c45c2

View file

@ -179,14 +179,13 @@ InstallExtension() {
# FIXME: Use case statements instead!
# Change link icon depending on website url.
local websiteiconclass="bx bx-link-external"
case "${website}" in
*"://github.com"* | *"://"*".github.com"*) local websiteiconclass="bx bx-git-branch" ;; # GitHub
*"://gitlab.io"* | *"://"*".gitlab.io"*) local websiteiconclass="bx bx-git-branch" ;; # GitLab
*) local websiteiconclass="bx bx-link-external" ;;
esac
# git
if [[ $website == *"://github.com/"* ]] || [[ $website == *"://www.github.com/"* ]] \
|| [[ $website == *"://github.com" ]] || [[ $website == *"://www.github.com" ]] \
|| [[ $website == *"://gitlab.com/"* ]] || [[ $website == *"://www.gitlab.com/"* ]] \
|| [[ $website == *"://gitlab.com" ]] || [[ $website == *"://www.gitlab.com" ]]; then local websiteiconclass="bx bx-git-branch";fi
# marketplaces
if [[ $website == *"://sourcexchange.net/"* ]] || [[ $website == *"://www.sourcexchange.net/"* ]] \
|| [[ $website == *"://sourcexchange.net" ]] || [[ $website == *"://www.sourcexchange.net" ]] \