From af3a2044b3486c1de3e5356835d475ffb4cc3249 Mon Sep 17 00:00:00 2001 From: Adam Eivy Date: Thu, 14 Aug 2014 17:19:39 -0700 Subject: [PATCH] configuring installer with user information and input (now it is all automated). bwahahahahaha! --- .gitconfig | 2 +- README.md | 14 -------------- install.sh | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 39 insertions(+), 16 deletions(-) diff --git a/.gitconfig b/.gitconfig index c05e51f23..8b7e84198 100644 --- a/.gitconfig +++ b/.gitconfig @@ -1,6 +1,6 @@ [user] name = Adam Eivy - email = adam.eivy@disney.com + email = Adam.Eivy@disney.com [color] # ui = true is a superset of all the more specific color options diff --git a/README.md b/README.md index 6f48b0a5a..5b2a8722b 100644 --- a/README.md +++ b/README.md @@ -20,20 +20,6 @@ git clone --recurse-submodules https://github.com/atomantic/dotfiles ~/.dotfiles ``` ## Setup -> \\[._.]/ - Hey, wouldn't it be cool if I walked you through these next steps on the terminal? -> Maybe you want to fork this repo and pull-request that to Adam! (he will probably get to it eventually) - -- Edit .gitconfig and change Adam's name to yours: -``` -[user] - name = Adam Eivy - email = adam.eivy@disney.com -... -[github] - # https://github.com/blog/180-local-github-config - user = atomantic -``` -- Change your user account system shell to zsh - Run the install script ```bash ./install.sh diff --git a/install.sh b/install.sh index 8e3717cbf..b81ea6786 100755 --- a/install.sh +++ b/install.sh @@ -10,7 +10,36 @@ source ./lib.sh export UNLINK=false -bot "Hi. I'm going to make your OSX system better." +bot "Hi. I'm going to make your OSX system better. But first, I need to configure this project based on your info so you don't check in files to github as Adam Eivy from here on out :)" + +#fullname=`osascript -e "long user name of (system info)"` +#me=`dscl . -read /Users/$(whoami)` +lastname=`dscl . -read /Users/$(whoami) | grep LastName | sed "s/LastName: //"` +firstname=`dscl . -read /Users/$(whoami) | grep FirstName | sed "s/FirstName: //"` +email=`dscl . -read /Users/$(whoami) | grep EMailAddress | sed "s/EMailAddress: //"` + + +echo -e "I see that your full name is $COL_YELLOW$firstname $lastname$COL_RESET" +read -r -p "Is this correct? [Y|n] " response +if [[ $response =~ ^(no|n|N) ]];then + read -r -p "What is your first name? " firstname + read -r -p "What is your last name? " lastname +fi +fullname="$firstname $lastname" + +bot "Great $fullname, " +echo -e "The best I can make out, your email address is $COL_YELLOW$email$COL_RESET" +read -r -p "Is this correct? [Y|n] " response +if [[ $response =~ ^(no|n|N) ]];then + read -r -p "What is your email? " email +fi + +read -r -p "What is your github.com username? " githubuser + +running "replacing items in .gitconfig with your info ($COL_YELLOW$fullname, $email, $githubuser$COL_RESET)" +sed -i 's/Adam Eivy/'$firstname' '$lastname'/' .gitconfig; +sed -i 's/adam.eivy@disney.com/'$email'/' .gitconfig; +sed -i 's/atomantic/'$githubuser'/' .gitconfig;ok # read -r -p "OK? [Y/n] " response # if [[ ! $response =~ ^(yes|y|Y| ) ]];then @@ -23,6 +52,14 @@ running "formatting configs for "$(whoami) sed -i 's/eivya001/'$(whoami)'/g' .zshrc;ok +echo $0 | grep zsh > /dev/null 2>&1 | true +if [[ ${PIPESTATUS[0]} != 0 ]]; then + running "changing your login shell to zsh" + chsh -s $(which zsh);ok +else + bot "looks like you are already using zsh. woot!" +fi + #export DOTFILESDIRRELATIVETOHOME=$PWD export DOTFILESDIRRELATIVETOHOME=.dotfiles pushd ~ > /dev/null 2>&1