Fixing Function
This commit is contained in:
		
							parent
							
								
									8a679661c2
								
							
						
					
					
						commit
						1874232f98
					
				@ -67,22 +67,24 @@ 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
 | 
				
			||||||
    (
 | 
					    (
 | 
				
			||||||
      cd "$dir" || exit 1
 | 
					      cd "$dir" || exit 1
 | 
				
			||||||
      # If it's a git directory, then update it
 | 
					      # If it's a git directory, then update it
 | 
				
			||||||
      if test -d .git; then
 | 
					       if test -d .git; then
 | 
				
			||||||
      if [ "$(grep -c "[branch "master"]" .git/config )" -gt 0 ]; then
 | 
					
 | 
				
			||||||
        echo "$dir is a Git repo. Pulling master branch..." && git checkout master && git pull && echo ""
 | 
					            if ["$(grep -c -i ""master"" $dir/.git/config )"] -gt 0; then
 | 
				
			||||||
        elif [ "$(grep -c "[branch "main"]" .git/config )" -gt 0 ]; then
 | 
					               echo "$dir is a Git repo. Pulling master branch..." && git checkout master && git pull && echo ""
 | 
				
			||||||
         echo "$dir is a Git repo. Pulling main branch..." && git checkout main && git pull && echo ""
 | 
					       
 | 
				
			||||||
         fi
 | 
					            elif ["$(grep -c -i ""main"" $dir/.git/config )"] -gt 0; then
 | 
				
			||||||
 | 
					               echo "$dir is a Git repo. Pulling main branch..." && git checkout main && git pull && echo ""
 | 
				
			||||||
 | 
					               fi
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        echo "$dir is not a Git repo." && echo ""
 | 
					        echo "$dir is not a Git repo." && echo ""
 | 
				
			||||||
      fi
 | 
					      fi
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
  done
 | 
					 done
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Updates packages from all sources
 | 
					# Updates packages from all sources
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user