Skip to content

Commit

Permalink
Update dotfiles install flow
Browse files Browse the repository at this point in the history
  • Loading branch information
ealeksandrov committed Aug 26, 2019
1 parent 28a0027 commit beb88df
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 20 deletions.
1 change: 0 additions & 1 deletion .bash/bash_profile
Expand Up @@ -7,4 +7,3 @@ so ~/.bash/prompt #
so ~/.bash/aliases #
so ~/.bash/functions #
so ~/.bash/path #
so ~/.bash/dotfilesrc # git-dotfiles specific stuff
4 changes: 0 additions & 4 deletions .bash/dotfilesrc

This file was deleted.

20 changes: 15 additions & 5 deletions .gitignore
@@ -1,6 +1,16 @@
# ignore all by default
/*
# OS noise
Desktop.ini
[Tt]humbs.db
.Spotlight-V100
*.DS_Store
.Trashes
._*
*~
*.swp
*.out
*.bak*

# do not ignore:
!.bash/
!.macos/
#Other CSM
.hg
.svn
CVS
11 changes: 1 addition & 10 deletions README.md
Expand Up @@ -3,16 +3,7 @@
## How To Use It

``` shell
git clone --bare git://github.com/ealeksandrov/dotfiles.git ~/dotfiles.git
#setup bash alias
alias .G="git --git-dir=$HOME/dotfiles.git --work-tree=$HOME/"

# commit original files in orig branch for backup
# WARNING: backup what's going to be overwritten
.G status -s -uno # review changelist
.G checkout -b original_files
.G commit -a -m 'original files'
.G checkout master
git clone https://github.com/ealeksandrov/dotfiles.git && cd dotfiles && source bootstrap.sh
```

## Clean system install
Expand Down
30 changes: 30 additions & 0 deletions bootstrap.sh
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

cd "$(dirname "${BASH_SOURCE}")";

git pull origin master;

function doIt() {
rsync --exclude ".git/" \
--exclude ".DS_Store" \
--exclude "iterm2/" \
--exclude "bootstrap.sh" \
--exclude ".macos" \
--exclude "brewfile" \
--exclude "bootstrap.sh" \
--exclude "README.md" \
--exclude "LICENSE" \
-avh --no-perms . ~;
source ~/.bash_profile;
}

if [ "$1" == "--force" -o "$1" == "-f" ]; then
doIt;
else
read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1;
echo "";
if [[ $REPLY =~ ^[Yy]$ ]]; then
doIt;
fi;
fi;
unset doIt;

0 comments on commit beb88df

Please sign in to comment.