From 5a6f293d902191ece5720838aa9c7d772c456ba9 Mon Sep 17 00:00:00 2001 From: LordMathis Date: Mon, 23 Dec 2024 18:43:10 +0100 Subject: [PATCH] Update install script --- README.md | 2 +- install.sh | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 5 deletions(-) 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