2019-01-30 21:31:45 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								#:  * `update-reset` [<repository>] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#: 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								#:  Fetches and resets Homebrew and all tap repositories (or any specified `repository`) using `git`(1) to their latest `origin/master`. Note this will destroy all your uncommitted or committed changes. 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-18 15:25:16 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								homebrew-update-reset( )  { 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  local  DIR
							 
						 
					
						
							
								
									
										
										
										
											2018-09-18 21:14:21 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  local  -a REPOS = ( ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-18 15:25:16 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  for  option in " $@ " 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  do 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    case  " $option "  in
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      -\? | -h| --help| --usage)           brew help  update-reset;  exit  $?  ; ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      --debug)                         HOMEBREW_DEBUG = 1  ; ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      -*) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        [ [  " $option "  =  *d* ] ]  &&  HOMEBREW_DEBUG = 1 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        ; ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								      *) 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-18 21:14:21 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								        REPOS += ( " $option " ) 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-18 15:25:16 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								        ; ; 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    esac 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  done 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  if  [ [  -n " $HOMEBREW_DEBUG "  ] ] 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  then 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    set  -x
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  fi 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-08 18:41:46 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  if  [ [  -z " ${ REPOS [*] } "  ] ] 
							 
						 
					
						
							
								
									
										
										
										
											2018-09-18 21:14:21 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  then 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    REPOS += ( " $HOMEBREW_REPOSITORY "  " $HOMEBREW_LIBRARY " /Taps/*/*) 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  fi 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2018-10-04 09:31:37 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  for  DIR in " ${ REPOS [@] } " 
							 
						 
					
						
							
								
									
										
										
										
											2016-12-18 15:25:16 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								  do 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    [ [  -d " $DIR /.git "  ] ]  ||  continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    cd  " $DIR "  ||  continue 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    echo  " ==> Fetching  $DIR ... " 
							 
						 
					
						
							
								
									
										
										
										
											2019-02-02 18:34:44 +01:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    git fetch --force --tags origin
							 
						 
					
						
							
								
									
										
										
										
											2016-12-18 15:25:16 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    echo 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    echo  " ==> Resetting  $DIR ... " 
							 
						 
					
						
							
								
									
										
										
										
											2017-01-26 16:29:39 +00:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								    git checkout --force -B master origin/master
							 
						 
					
						
							
								
									
										
										
										
											2016-12-18 15:25:16 -08:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								    echo 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  done 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}