#!/bin/bash
rm -rf ~/update-buddy
echo "Downloading..."
git_clone https://github.com/Botspot/update-buddy || error 'Failed to download update-buddy repository!'

echo "Making autostart entry..."
mkdir -p ~/.config/autostart
echo "[Desktop Entry]
Name=Update Buddy
Exec=$HOME/update-buddy/onstartup.sh
Type=Application
X-GNOME-Autostart-enabled=true
Hidden=false
NoDisplay=false" > ~/.config/autostart/update-buddy.desktop

chmod +x $HOME/update-buddy/onstartup.sh

echo "Running Update Buddy for the first time..."
#first time run
setsid $HOME/update-buddy/onstartup.sh &
