From e54b2889f0f7abb43ca0d61e8eb24fd4fdf11601 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Sun, 31 Dec 2023 17:26:34 -0500 Subject: [PATCH] Sublime Text: switch to `add_external_repo` and `rm_external_repo` --- apps/Sublime Text/install-64 | 20 +++++++++++--------- apps/Sublime Text/uninstall | 6 +++++- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/apps/Sublime Text/install-64 b/apps/Sublime Text/install-64 index 4c8323d5338..5d62811f072 100755 --- a/apps/Sublime Text/install-64 +++ b/apps/Sublime Text/install-64 @@ -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 diff --git a/apps/Sublime Text/uninstall b/apps/Sublime Text/uninstall index 2ca7ee67839..2f65d1d76bd 100755 --- a/apps/Sublime Text/uninstall +++ b/apps/Sublime Text/uninstall @@ -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"