_script="$(realpath ${BASH_SOURCE[0]})" _scriptname="$(basename $_script)" _scriptdir="$(dirname $_script)" _modulename="$(basename $_scriptdir)" DOT_MODULE_NAME="git" function preinstall() { if ! [[ -x "$(command -v git)" ]]; then PACKAGES+=("git") fi if ! [[ -x "$(command -v fzf)" ]]; then PACKAGES+=("fzf") fi } function install() { # backup old file if it exists and we haven't backed it up before if [[ -f "$HOME/.gitconfig" ]] && ! [[ -f "$HOME/.gitconfig.bak" ]] && ! [[ -f "$_scriptdir/.firstrun" ]]; then log verbose "making backup" cp "$HOME/.gitconfig" "$HOME/.gitconfig.bak" touch "$_scriptdir/.firstrun" fi log info "linking gitconfig" ln -sf "$_scriptdir/gitconfig" "$HOME/.gitconfig" }