Added new pulldots function to git pull dotfiles without having to navigate to git folder
This commit is contained in:
		
							parent
							
								
									60fad5d51f
								
							
						
					
					
						commit
						5d84d50f4e
					
				| @ -121,6 +121,7 @@ fi | |||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| # Pull all Git repos in this dir | # Pull all Git repos in this dir | ||||||
|  | 
 | ||||||
| function pullall() { | function pullall() { | ||||||
|   for dir in * ; do |   for dir in * ; do | ||||||
|     # Execute in subshell |     # Execute in subshell | ||||||
| @ -142,6 +143,22 @@ function pullall() { | |||||||
|  done |  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 | # Updates packages for all Distros | ||||||
| function update() { | function update() { | ||||||
| sudo -v | sudo -v | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user