Add projects-status script
This commit is contained in:
		
							parent
							
								
									96e747d087
								
							
						
					
					
						commit
						1c9aed3d3c
					
				
							
								
								
									
										26
									
								
								bin/projects-status
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										26
									
								
								bin/projects-status
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,26 @@ | |||||||
|  | #!/bin/bash | ||||||
|  | 
 | ||||||
|  | ################################################################################ | ||||||
|  | # | ||||||
|  | # projects-status | ||||||
|  | # Reports whether any git repositories in ~/Projects are in a dirty state | ||||||
|  | # | ||||||
|  | ################################################################################ | ||||||
|  | 
 | ||||||
|  | echo "Projects with changes in ${HOME}/Projects/:" | ||||||
|  | for DIR in ${HOME}/Projects/*/; do | ||||||
|  | 
 | ||||||
|  |     # Make sure this is a git repository | ||||||
|  |     if ! [ -d "${DIR/.git}" ]; then | ||||||
|  |         continue | ||||||
|  |     fi | ||||||
|  | 
 | ||||||
|  |     # Report whether or not the repository is in a dirty state | ||||||
|  |     CHANGED=$(git -C "${DIR}" status --porcelain) | ||||||
|  |     if ! [ -z "${CHANGED}" ]; then | ||||||
|  |         PROJECT_NAME="${DIR%/}" | ||||||
|  |         PROJECT_NAME="${PROJECT_NAME##*/}" | ||||||
|  |         echo "${PROJECT_NAME}" | ||||||
|  |     fi | ||||||
|  | 
 | ||||||
|  | done | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user