#!/bin/bash

installDir="$HOME/.local/bin/"
sgDir="$HOME/.sg"
libDir="/usr/local/lib/SimplyGit/"

if [ ! -d $installDir ]; then
echo "Making $installDir"
mkdir -p $installDir
fi

if [ ! -d $libDir ]; then
echo "Making $libDir"
sudo mkdir -p $libDir
fi

if [ ! -d $sgDir ]; then
echo "Making $sgDir"
mkdir -p $sgDir
fi

echo "Copying bin"
cp ./sg $installDir

if [ ! -f $sgDir/sg.config ]; then
echo "Copying default config"
cp ./example.config $sgDir/sg.config
else
echo "Found config file not overwriting"
fi

echo "Calling sudo to copy libs"
sudo cp ./lib/SimplyGit/* $libDir