#!/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
}



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
