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

VERSION=arduino-1.8.15

cd ~/.local/share

$VERSION/uninstall.sh || error "Failed to run uninstall.sh as $USER user"
sudo $VERSION/uninstall.sh || error "Failed to run uninstall.sh as root user"
rm -rf $VERSION || error "Failed to remove arduino-1.8.13 folder"

