#!/usr/bin/env bash
# install: part of the 4U6U57/dotfiles project
# INSTALL: Run this script to install this repo
# Installer script for the dotfiles repo, calls the dotbot utility
# Based off of anishathalye/dotbot

set -e

CONFIG="install.conf.yaml"
DOTBOT_DIR="dotbot"

DOTBOT_BIN="bin/dotbot"
BASE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PLUGIN_DIR="${BASE_DIR}/plugins/*"

cd "${BASE_DIR}"
git pull origin master
git submodule update --init --recursive "${DOTBOT_DIR}"

"${BASE_DIR}/${DOTBOT_DIR}/${DOTBOT_BIN}" \
  -d "${BASEDIR}" -c "${CONFIG}" --plugin-dir ${PLUGIN_DIR} "${@}"
