From abf35c45c25eb78f0ad4d15700712247da7cae9e Mon Sep 17 00:00:00 2001 From: prplwtf Date: Sun, 22 Sep 2024 17:42:35 +0200 Subject: [PATCH] feat `install.sh`: move github/gitlab weburl detection into case statement --- scripts/commands/extensions/install.sh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/commands/extensions/install.sh b/scripts/commands/extensions/install.sh index 892bc8a..ac4ef85 100644 --- a/scripts/commands/extensions/install.sh +++ b/scripts/commands/extensions/install.sh @@ -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" ]] \