Skip to content

Commit

Permalink
Sublime Text: switch to add_external_repo and rm_external_repo
Browse files Browse the repository at this point in the history
  • Loading branch information
theofficialgman committed Jan 1, 2024
1 parent 49ad685 commit e54b288
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
20 changes: 11 additions & 9 deletions apps/Sublime Text/install-64
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash

status "Adding GPG key..."
wget -qO- https://download.sublimetext.com/sublimehq-pub.gpg | sudo tee /etc/apt/trusted.gpg.d/sublimehq.asc || error "Failed to add GPG key for sublime-text repository!"
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list

(install_packages sublime-text)
if [ $? != 0 ];then
#if install_packages fails, remove repository
sudo rm -f /etc/apt/sources.list.d/sublime-text.list
exit 1
#remove deprecated files
sudo rm -f /etc/apt/trusted.gpg.d/sublimehq.asc /etc/apt/sources.list.d/sublime-text.list

add_external_repo "sublimehq" "https://download.sublimetext.com/ apt/stable/" "https://download.sublimetext.com/sublimehq-pub.gpg" || exit 1

apt_update
if [ $? != 0 ]; then
rm_external_repo "sublimehq"
error "Failed to perform apt update after adding sublimehq repository."
fi

install_packages sublime-text || exit 1
6 changes: 5 additions & 1 deletion apps/Sublime Text/uninstall
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,8 @@
rm -f ~/.local/share/applications/sublime-text.desktop
rm -rf ~/"Sublime Text 2"
purge_packages || exit 1
remove_repofile_if_unused /etc/apt/sources.list.d/sublime-text.list

#remove deprecated files
sudo rm -f /etc/apt/trusted.gpg.d/sublimehq.asc /etc/apt/sources.list.d/sublime-text.list

rm_external_repo "sublimehq"

0 comments on commit e54b288

Please sign in to comment.