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

# Get dependencies
"${DIRECTORY}/pkg-install" "python-pip python-gobject-2 python-dbus python-tk python-gtk2 python-requests tkdnd" "$(dirname "$0")" || exit 1

cd ~ && wget https://github.com/KenT2/tboplayer/tarball/master -O - | tar xz || error "Failed to download!"
cd KenT2-tboplayer-* && chmod +x setup.sh && ./setup.sh || error "failed to run setup.sh!"
