2018-02-22 04:15:49 +00:00
|
|
|
#!/bin/bash
|
2018-04-12 18:07:33 +00:00
|
|
|
# Description: The Git version control system
|
2018-02-27 05:15:14 +00:00
|
|
|
set -e
|
2018-02-22 04:15:49 +00:00
|
|
|
|
2020-06-24 23:50:29 +00:00
|
|
|
GIT_NAME="Correl Roush"
|
|
|
|
GIT_EMAIL="correl@gmail.com"
|
|
|
|
|
2018-02-23 22:04:15 +00:00
|
|
|
case $_PLATFORM in
|
|
|
|
darwin)
|
|
|
|
_recipe brew
|
|
|
|
_brew git
|
|
|
|
;;
|
2021-02-05 00:05:51 +00:00
|
|
|
arch)
|
|
|
|
_recipe _arch
|
|
|
|
_pacman git
|
|
|
|
;;
|
|
|
|
debian)
|
2018-02-23 22:04:15 +00:00
|
|
|
_recipe _apt
|
|
|
|
_ppa git-core/ppa
|
|
|
|
_apt git
|
|
|
|
;;
|
|
|
|
esac
|
2018-05-30 13:45:49 +00:00
|
|
|
|
|
|
|
function _git {
|
|
|
|
local repo=$1
|
|
|
|
local dest=$2
|
|
|
|
if ! test -d "$dest"; then
|
|
|
|
_run "[git] Clone $repo to $dest" git clone --recursive $1 $2
|
|
|
|
else
|
|
|
|
echo "[git] $dest already exists, skipping."
|
|
|
|
fi
|
|
|
|
}
|
2020-06-24 23:50:29 +00:00
|
|
|
|
2020-06-25 01:30:17 +00:00
|
|
|
git config --global user.email >/dev/null || _run "[git] Setting user.email to '$GIT_EMAIL'" git config --global user.email $GIT_EMAIL
|
|
|
|
git config --global user.name >/dev/null || _run "[git] Setting user.name to '$GIT_NAME'" git config --global user.name $GIT_NAME
|