linutil/core/tabs/applications-setup/developer-tools/vscodium-setup.sh

48 lines
2.5 KiB
Bash
Raw Normal View History

2024-09-21 15:26:32 +01:00
#!/bin/sh -e
. ../../common-script.sh
installVsCodium() {
if ! command_exists com.vscodium.codium && ! command_exists codium; then
2024-09-21 15:26:32 +01:00
printf "%b\n" "${YELLOW}Installing VS Codium...${RC}"
case "$PACKAGER" in
apt-get|nala)
2024-09-21 15:26:32 +01:00
curl -fsSL https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | gpg --dearmor | "$ESCALATION_TOOL" dd of=/usr/share/keyrings/vscodium-archive-keyring.gpg
echo 'deb [ signed-by=/usr/share/keyrings/vscodium-archive-keyring.gpg ] https://download.vscodium.com/debs vscodium main' | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/vscodium.list
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y codium
2024-09-21 15:26:32 +01:00
;;
zypper)
"$ESCALATION_TOOL" rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=gitlab.com_paulcarroty_vscodium_repo\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/zypp/repos.d/vscodium.repo
"$ESCALATION_TOOL" "$PACKAGER" refresh
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install codium
2024-09-21 15:26:32 +01:00
;;
pacman)
"$AUR_HELPER" -S --noconfirm vscodium-bin
;;
dnf)
"$ESCALATION_TOOL" rpmkeys --import https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg
printf "%b\n" "[gitlab.com_paulcarroty_vscodium_repo]\nname=download.vscodium.com\nbaseurl=https://download.vscodium.com/rpms/\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/-/raw/master/pub.gpg\nmetadata_expire=1h" | "$ESCALATION_TOOL" tee -a /etc/yum.repos.d/vscodium.repo
"$ESCALATION_TOOL" "$PACKAGER" install -y codium
2024-09-21 15:26:32 +01:00
;;
apk)
checkFlatpak
flatpak install -y flathub com.vscodium.codium
;;
2024-09-21 15:26:32 +01:00
*)
printf "%b\n" "${RED}Unsupported package manager: ""$PACKAGER""${RC}"
exit 1
2024-09-21 15:26:32 +01:00
;;
esac
else
printf "%b\n" "${GREEN}VS Codium is already installed.${RC}"
fi
}
checkEnv
checkEscalationTool
checkAURHelper
installVsCodium