From 876722f1697fd5f05d7b6b36e5d0c51243738436 Mon Sep 17 00:00:00 2001 From: Botspot Date: Sun, 25 Jul 2021 16:19:24 -0500 Subject: [PATCH] Sublime text: add install-64 --- apps/Sublime Text/install-64 | 18 ++++++++++++++++++ apps/Sublime Text/uninstall | 13 +++++++++++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100755 apps/Sublime Text/install-64 diff --git a/apps/Sublime Text/install-64 b/apps/Sublime Text/install-64 new file mode 100755 index 0000000..3db8074 --- /dev/null +++ b/apps/Sublime Text/install-64 @@ -0,0 +1,18 @@ +#!/bin/bash + +DIRECTORY="$(dirname "$(dirname "$( cd "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )")")" + +function error { + echo -e "\\e[91m$1\\e[39m" + exit 1 +} + +echo "Adding GPG key..." +wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add - || 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 + +sudo apt update || error "Failed to run 'sudo apt update'!" + +sudo apt install sublime-text || error "APT failed to install sublime-text package!" + diff --git a/apps/Sublime Text/uninstall b/apps/Sublime Text/uninstall index c42ec2c..c2ba40b 100755 --- a/apps/Sublime Text/uninstall +++ b/apps/Sublime Text/uninstall @@ -7,8 +7,17 @@ function error { exit 1 } -rm ~/.local/share/applications/sublime-text.desktop -rm -rf ~/"Sublime Text 2" + +if [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 64)" ];then + #arch=64 + sudo apt purge sublime-text +elif [ ! -z "$(file "$(readlink -f "/sbin/init")" | grep 32)" ];then + #arch=32 + rm -f ~/.local/share/applications/sublime-text.desktop + rm -rf ~/"Sublime Text 2" +else + error "Failed to detect OS CPU architecture! Something is very wrong." +fi exit 0