Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/usr/bin/env bash

# Display ASCII art
cat << "EOF"
___ ____ __ _ ___ __ ____ __
/ _ \___ / _(_) /__ ____ ( )___ / _ \___ / /_/ _(_) /__ ___
/ // / -_) _/ / / _ `/ _ \|/(_-< / // / _ \/ __/ _/ / / -_|_-<
/____/\__/_//_/_/\_,_/_//_/ /___/ /____/\___/\__/_//_/_/\__/___/
EOF
echo "Please choose a configuration:"
echo "1) Lightweight (Essentials only)"
echo "2) Developer/Engineering Config"
echo "3) Productivity/Full Config"
echo "4) Quit"
read -rp "Enter the number of your choice: " config_choice

case $config_choice in
Expand All @@ -16,6 +23,9 @@ case $config_choice in
3)
configtemplate="home"
;;
4)
exit 0
;;
*)
echo "Invalid choice, defaulting to Bare Bones"
configtemplate="lightweight"
Expand All @@ -25,12 +35,8 @@ esac
export CONFIG=$configtemplate
echo "You chose this configuration: $config_choice ($configtemplate)"

# Prompt the user for their git username and email
read -rp "Enter your git username: " git_username
read -rp "Enter your git email: " git_email

# Replace the placeholders in the gitconfig file with the user's git username and email
sed -e "s/GIT_USERNAME/$git_username/g" -e "s/GIT_EMAIL/$git_email/g" git/gitconfig.symlink.template > git/gitconfig.symlink
echo "Configuring Git"
source install/git.sh

echo "Installing dotfiles"
source install/link.sh
Expand Down
19 changes: 19 additions & 0 deletions install/git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

# Check if user.name and user.email are set in the existing gitconfig
git_username=$(git config --get user.name)
git_email=$(git config --get user.email)
echo "Your system's git username is: $git_username"
echo "Your system's git email is: $git_email"


# If user.name or user.email are not set, prompt the user for their git username and email
if [[ -z $git_username ]]; then
read -rp "Enter your git username: " git_username
fi
if [[ -z $git_email ]]; then
read -rp "Enter your git email: " git_email
fi

# Replace the placeholders in the gitconfig file with the user's git username and email
sed -e "s/GIT_USERNAME/$git_username/g" -e "s/GIT_EMAIL/$git_email/g" git/gitconfig.symlink.template > git/gitconfig.symlink