mirror of
				https://github.com/vmstan/gravity-sync.git
				synced 2025-10-30 08:42:23 -04:00 
			
		
		
		
	Check git status before update
This commit is contained in:
		
							parent
							
								
									cfd49f7566
								
							
						
					
					
						commit
						df42d91c8b
					
				| @ -108,10 +108,22 @@ function update_gs { | |||||||
| 		BRANCH='master' | 		BRANCH='master' | ||||||
| 	fi | 	fi | ||||||
| 
 | 
 | ||||||
| 	MESSAGE="Requires GitHub Installation"  | 	GIT_CHECK=$(git status | awk '{print $1}') | ||||||
| 	echo_info | 	if [ $GIT_CHECK == "fatal:" ] | ||||||
|  | 	then | ||||||
|  | 		MESSAGE="Requires GitHub Installation"  | ||||||
|  | 		echo_warn | ||||||
|  | 		exit_nochange | ||||||
|  | 	elif [ $GIT_CHECK == "HEAD" ] | ||||||
| 		git fetch --all | 		git fetch --all | ||||||
| 		git reset --hard origin/${BRANCH} | 		git reset --hard origin/${BRANCH} | ||||||
|  | 	else | ||||||
|  | 		MESSAGE="This might break..."  | ||||||
|  | 		echo_warn | ||||||
|  | 		git fetch --all | ||||||
|  | 		git reset --hard origin/${BRANCH} | ||||||
|  | 	fi  | ||||||
|  | 		 | ||||||
| 	exit | 	exit | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user