#!/usr/bin/env bash # vim: ft=sh [[ -z $(command -v git) ]] && { echo "Please install xcode-tools on MacOSX, or git on Linux before running this script." exit 1 } export BashMatic="${HOME}/.bashmatic" if [[ ! -f "${BashMatic}/init.sh" || ! -d "${BashMatic}" ]] ; then rm -rf "${BashMatic}" 2>/dev/null git clone https://github.com/kigster/bashmatic "${BashMatic}" 1>/dev/null 2>&1 else set +e # ignore errors here cd "${BashMatic}" && git pull -q && cd - >/dev/null fi set -e # Load the library source "${BashMatic}"/init.sh # Add a hook to ~/.bashrc bashmatic.load-at-login # Add a banner. box::yellow-in-red "Welcome to BashMatic version ${bldylw}${BashMatic__Version}" \ "It has been installed in your home folder, inside ${BashMatic} directory." \ "Start a new Shell so that BashMatic loads, and checkout the pre-loaded " \ "functions that start with 'bashmatic.*' — they have useful helpers for " \ "using this library." success "BashMatic installed successfully."