Skip to content

Commit

Permalink
configuring installer with user information and input (now it is all …
Browse files Browse the repository at this point in the history
…automated). bwahahahahaha!
  • Loading branch information
atomantic committed Aug 15, 2014
1 parent 3006087 commit af3a204
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitconfig
Original file line number Diff line number Diff line change
@@ -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
Expand Down
14 changes: 0 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [email protected]
...
[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
Expand Down
39 changes: 38 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]/'$email'/' .gitconfig;
sed -i 's/atomantic/'$githubuser'/' .gitconfig;ok

# read -r -p "OK? [Y/n] " response
# if [[ ! $response =~ ^(yes|y|Y| ) ]];then
Expand All @@ -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
Expand Down

0 comments on commit af3a204

Please sign in to comment.