Skip to content
Snippets Groups Projects
Commit 957d360b authored by Brandon Rodriguez's avatar Brandon Rodriguez
Browse files

Add git configuration option

parent 6a92646b
Branches
No related merge requests found
...@@ -9,7 +9,7 @@ set -e ...@@ -9,7 +9,7 @@ set -e
# Import utility script. # Import utility script.
source $(dirname $0)/utils.sh source $(dirname $0)/src/utils.sh
### ###
...@@ -34,13 +34,31 @@ function main () { ...@@ -34,13 +34,31 @@ function main () {
# Display options. # Display options.
echo "" echo ""
echo -e "${text_blue}Select an option:${text_reset}" echo -e "${text_blue}Select an option:${text_reset}"
echo -e "${text_cyan}1${text_reset}) Initialize Git"
echo -e "${text_cyan}0${text_reset}) Exit"
# Get user input. # Get user input.
read user_input read user_input
echo "" # Handle based on selected option.
echo -e "${text_blue}Exiting program.${text_reset}" if [[ "${user_input}" == "1" ]]
run_script_loop=false then
pwd
echo ""
# Git initialization.
./initialize_git.sh
elif [[ "${user_input}" == "0" ]]
then
echo ""
echo -e "${text_blue}Exiting program.${text_reset}"
run_script_loop=false
else
echo ""
echo -e "${text_red}Unrecognized selection.${text_reset}"
fi
done done
......
#!/usr/bin/env bash
###
# Run basic git initialization.
# The commands are simple in themselves, but I tend to forget about them on initial install.
##
# Abort on error
set -e
# Import utility script.
source $(dirname $0)/utils.sh
###
# Program main.
##
function main () {
echo ""
echo -e "${text_blue}Setting up basic git configuration.${text_reset}"
# Install git and tk.
echo -e "${text_blue}Checking apt for git. This may ask for your system password.${text_reset}"
sudo apt install git gitk
# Set up git email credentials for machine.
user_input=""
while [[ "${user_input}" == "" ]]
do
echo ""
echo -e "${text_cyan}Please provide desired email for git. Ex: \"you@example.com\"${text_reset}"
# Get user input.
read user_input
done
echo "git config --global user.email \"${user_input}\""
git config --global user.email "${user_input}"
# Set up git name credentials for machine.
user_input=""
while [[ "${user_input}" == "" ]]
do
echo ""
echo -e "${text_cyan}Please provide desired full name for git. Ex: \"Your Name\"${text_reset}"
# Get user input.
read user_input
done
echo "git config --global user.name \"${user_input}\""
git config --global user.name "${user_input}"
}
main
File moved
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment