linutil/core/tabs/applications-setup/Developer-tools/sublime-setup.sh

43 lines
1.8 KiB
Bash
Raw Normal View History

2024-09-21 15:26:32 +01:00
#!/bin/sh -e
. ../../common-script.sh
installSublime() {
if ! command_exists sublime; then
printf "%b\n" "${YELLOW}Installing Sublime...${RC}"
case "$PACKAGER" in
apt-get|nala)
2024-09-21 15:26:32 +01:00
curl -fsSL https://download.sublimetext.com/sublimehq-pub.gpg | "$ESCALATION_TOOL" apt-key add -
echo "deb https://download.sublimetext.com/ apt/stable/" | "$ESCALATION_TOOL" tee /etc/apt/sources.list.d/sublime-text.list
"$ESCALATION_TOOL" "$PACKAGER" update
"$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text
2024-09-21 15:26:32 +01:00
;;
zypper)
"$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
"$ESCALATION_TOOL" "$PACKAGER" addrepo -g -f https://download.sublimetext.com/rpm/dev/x86_64/sublime-text.repo
"$ESCALATION_TOOL" "$PACKAGER" refresh
"$ESCALATION_TOOL" "$PACKAGER" --non-interactive install sublime-text
2024-09-21 15:26:32 +01:00
;;
pacman)
"$AUR_HELPER" -S --needed --noconfirm sublime-text-4
2024-09-21 15:26:32 +01:00
;;
dnf)
"$ESCALATION_TOOL" rpm -v --import https://download.sublimetext.com/sublimehq-rpm-pub.gpg
"$ESCALATION_TOOL" "$PACKAGER" config-manager --add-repo https://download.sublimetext.com/rpm/stable/x86_64/sublime-text.repo
"$ESCALATION_TOOL" "$PACKAGER" install -y sublime-text
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}Sublime is already installed.${RC}"
fi
}
checkEnv
checkEscalationTool
installSublime