From 5d84d50f4e4b1481b3295797eeb7973e034c08ed Mon Sep 17 00:00:00 2001 From: Phil Date: Sat, 29 Jan 2022 02:34:29 +0000 Subject: [PATCH] Added new pulldots function to git pull dotfiles without having to navigate to git folder --- .bash_aliases | 17 +++++++++++++++++ .vimrc | 1 - 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.bash_aliases b/.bash_aliases index 9c71eef..c50b7d2 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -121,6 +121,7 @@ fi # Pull all Git repos in this dir + function pullall() { for dir in * ; do # Execute in subshell @@ -142,6 +143,22 @@ function pullall() { done } +# Pull Dotfiles inside ~/git/dotfiles +function pulldots() { + + # Check if folders are there and if its Master or Main + if [ "$(grep -c -i ""master"" ~/git/dotfiles/.git/config )" -gt 0 ]; then + echo "dotfiles Found, Pulling master branch..." && cd ~/git/dotfiles && git checkout master && git pull && echo "" + + + elif [ "$(grep -c -i ""main"" ~/git/dotfiles/.git/config )" -gt 0 ]; then + echo "dotfiles Found, Pulling main branch..." && cd ~/git/dotfiles && git checkout main && git pull && echo "" + + else + echo "I can't seem to file any dotfiles folders" && echo "" + fi +} + # Updates packages for all Distros function update() { sudo -v diff --git a/.vimrc b/.vimrc index f9714e8..23b14dc 100644 --- a/.vimrc +++ b/.vimrc @@ -1,4 +1,3 @@ -##DOWNLOADED FROM GIT REPO## syntax on set tabstop=4 filetype on