diff --git a/README.md b/README.md index 4244dd6..a26ea2b 100644 --- a/README.md +++ b/README.md @@ -20,4 +20,4 @@ My dotfiles. If you want to use them fork or clone the repo. Each branch has spe * `config submodule update` * `source .zshrc` -## [Full Guide](https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/) +**[Full Guide](https://developer.atlassian.com/blog/2016/02/best-way-to-store-dotfiles-git-bare-repo/)** diff --git a/install.sh b/install.sh index a2da75a..37527f2 100755 --- a/install.sh +++ b/install.sh @@ -6,10 +6,20 @@ if [ $# -eq 0 ] exit 1; fi +BRANCH=$1 + + echo ".dotfiles" >> $HOME/.gitignore + git clone --bare https://github.com/LordMathis/dotfiles.git $HOME/.dotfiles -alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME' -config checkout $1 + +function config { + /usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME "$@" +} + +cd $HOME + +config checkout $BRANCH + config submodule init -config submodule update -source .zshrc \ No newline at end of file +config submodule update --recursive --remote \ No newline at end of file