git-multi-user/git-start

28 lines
602 B
Plaintext
Raw Permalink Normal View History

2020-11-04 21:31:18 +00:00
#!/usr/bin/env bash
2020-12-09 18:26:04 +00:00
set -eu
2020-12-09 18:29:52 +00:00
2020-11-04 21:31:18 +00:00
if [ "$#" -ne 1 ]; then
2020-12-09 18:26:04 +00:00
echo "Hey man, give me your name !"
echo "See, like this:"
2020-11-04 21:31:18 +00:00
echo " $0 roberto"
exit
fi
2020-12-09 18:26:04 +00:00
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
CONFIG=${ROOT_DIR}"/gitconfig_$1"
2020-11-04 21:31:18 +00:00
if [ ! -f "$CONFIG" ]; then
2020-12-09 18:26:04 +00:00
echo "Your configuration file '${CONFIG}' does not exist. :("
echo "Create it in '${ROOT_DIR}'"
2020-11-04 21:31:18 +00:00
exit
fi
git config --local include.path $CONFIG
2020-12-09 18:26:04 +00:00
echo "Your git configuration '${CONFIG}' is well loaded. Enjoy !"
echo "When job is done, don't forget to clean it:"
2020-11-04 21:31:18 +00:00
echo " git-stop"