#!/bin/bash # # Git templater module. # # Parameters SHARE="$1" # Include basic functions source $SHARE/templater/functions || exit 1 # Git implementation function templater_git { if [ ! -d ".git" ]; then templater_echo "Setting up git..." touch .gitignore templater_user_input GIT_USER User "-> Choose a git user name" templater_user_input GIT_EMAIL user@example.org "-> Choose a git email address" git init git config user.name "$GIT_USER" git config user.email "$GIT_EMAIL" git add . git commit -m "Initial import" else templater_echo "Git already set" fi } # Dispatch templater_git