Skip to content

Commit

Permalink
Merge pull request #87 from benknoble/dev-1.1
Browse files Browse the repository at this point in the history
1.1 Features
  • Loading branch information
benknoble committed Jul 30, 2017
2 parents 781ccd6 + 72faf79 commit 8fe8352
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 39 deletions.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

## Your Environment
<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used (e.g. *Dotfiles 1.0* or *commit 7c102b6*):
* Operating System and version (e.g. *OS X 10.11.6*):
* CLI used (e.g. *Terminal*):
* Version info of relevant software (e.g. *Vim*):
* Version used: **Dotfiles commit 7c102b6**
* Operating System and version: **OS X 10.11.6**
* CLI used: **Terminal**
* Version info of relevant software: **Vim**
6 changes: 5 additions & 1 deletion docs/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ have a nice, large Terminal screen with dark background and white font.

### Gitconfig

*Contains important git aliases.* Here's the quick list:
*Contains important git aliases.* The caveat is that it also contains my user
info, so if you value your identity follow the installation prompts closely. You
may also want to run `setup/git-setup.sh` every now and then just in case.

Here's the quick list:

- **cd** for checking out branches.

Expand Down
2 changes: 1 addition & 1 deletion docs/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
│   ├── aliases.md
│   ├── features.md
│   ├── functions.md
│   ├── installed.md
│   ├── humans.txt
│   ├── installed.md
│   └── tree.md
├── gitconfig
├── gitignore_global
Expand Down
1 change: 0 additions & 1 deletion gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
[color]
ui = true
[core]
autocrlf = input
excludesfile = ~/.gitignore_global
[diff]
submodule = log
Expand Down
80 changes: 49 additions & 31 deletions setup/git-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,64 @@ config() {
echo "git $1 $2 = $u_in"
}

echo "Configuring git..."
echo

# reconfigure user name, email address
echo "Configure user name and email..."
name="$(git config --global --get user.name)"
email="$(git config --global --get user.email)"
# Usage: config_user_info
# -- Configures user information for someone other than Ben Knoble
config_user_info() {
name="$(git config --global --get user.name)"
email="$(git config --global --get user.email)"

if [[ -z "$name" ]]; then
echo "No previous user name"
config user name
else
echo "Previous user name: $name"
read -n 1 -p "Is [name = $name] ok [Y/n] ? " nameok && echo
if [[ !("$nameok" =~ ^(y|Y)) ]]; then
if [[ -z "$name" ]]; then
echo "No previous user name"
config user name
else
echo "Previous user name: $name"
read -n 1 -p "Is [name = $name] ok [Y/n] ? " nameok && echo
if [[ !("$nameok" =~ ^(y|Y)) ]]; then
config user name
fi
fi
fi
echo
echo

if [[ -z "$email" ]]; then
echo "No previous user email"
config user email
else
echo "Previous user email: $email"
read -n 1 -p "Is [email = $email] ok [Y/n] ? " emailok && echo
if [[ !("$emailok" =~ ^(y|Y)) ]]; then
if [[ -z "$email" ]]; then
echo "No previous user email"
config user email
else
echo "Previous user email: $email"
read -n 1 -p "Is [email = $email] ok [Y/n] ? " emailok && echo
if [[ !("$emailok" =~ ^(y|Y)) ]]; then
config user email
fi
fi
fi
echo
}

echo "...done with user info"
echo "Configuring git..."
echo

echo "Configure global gitignore..."
# replace with the name of your global gitignore file if you've changed it
globalignore="~/.gitignore_global"
git config --global --replace-all core.excludesfile "$globalignore"
echo "...done with global gitignore"
[[ -e ~/.gitconfig ]] && {
echo "Backing up gitconfig..."
mv -f ~/.gitconfig ~/Dotfiles_old/gitconfig
echo "...done backing up gitconfig"
echo
}

# Check if Ben Knoble
read -n 1 -p "Are you Ben Knoble (@benknoble) [Y/n] ? " ben && echo
if [[ "$ben" =~ ^(y|Y) ]]; then
# Symlink gitconfig
echo "Symlinking gitconfig..."
ln -s ~/Dotfiles/gitconfig ~/.gitconfig
else
# Copy gitconfig
echo "Copying gitconfig..."
cp ~/Dotfiles/gitconfig ~/.gitconfig

# Reconfigure user name, email address
echo "Configure user name and email..."
config_user_info
echo "...done with user info"
fi

echo "...done with gitconfig"
echo

echo "...done configuring git"
2 changes: 1 addition & 1 deletion setup/makesymlinks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
dir=~/Dotfiles # dotfiles directory
olddir=~/Dotfiles_old # old dotfiles backup directory
# list of files/folders to symlink in homedir
files="bash_profile vimrc bashrc inputrc gitconfig gitignore_global vim"
files="bash_profile vimrc bashrc inputrc gitignore_global vim"

##########

Expand Down

0 comments on commit 8fe8352

Please sign in to comment.