#!/bin/bash

#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/sublimehq-pub.gpg" "https://download.sublimetext.com/" "apt/stable/" || 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
