| 
				
			 | 
			
			
				@@ -6116,18 +6116,16 @@ function install_gogs { 
			 | 
		
	
		
			
			| 
				6116
			 | 
			
				6116
			 | 
			
			
				   export GOPATH=/home/git/go 
			 | 
		
	
		
			
			| 
				6117
			 | 
			
				6117
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				6118
			 | 
			
				6118
			 | 
			
			
				   # update to the next commit 
			 | 
		
	
		
			
			| 
				6119
			 | 
			
				
			 | 
			
			
				-  if [ -d /var/www/$GIT_DOMAIN_NAME/htdocs ]; then 
			 | 
		
	
		
			
			| 
				
			 | 
			
				6119
			 | 
			
			
				+  if [ -d /var/www/$GIT_DOMAIN_NAME ]; then 
			 | 
		
	
		
			
			| 
				6120
			 | 
			
				6120
			 | 
			
			
				       if grep -q "Gogs commit" $COMPLETION_FILE; then 
			 | 
		
	
		
			
			| 
				6121
			 | 
			
				6121
			 | 
			
			
				           CURRENT_GOGS_COMMIT=$(grep "Gogs commit" $COMPLETION_FILE | awk -F ':' '{print $2}') 
			 | 
		
	
		
			
			| 
				6122
			 | 
			
				6122
			 | 
			
			
				           if [[ "$CURRENT_GOGS_COMMIT" != "$GOGS_COMMIT" ]]; then 
			 | 
		
	
		
			
			| 
				6123
			 | 
			
				
			 | 
			
			
				-              cd /var/www/$GIT_DOMAIN_NAME/htdocs 
			 | 
		
	
		
			
			| 
				
			 | 
			
				6123
			 | 
			
			
				+              cd $GOPATH/src/github.com/gogits/gogs 
			 | 
		
	
		
			
			| 
				6124
			 | 
			
				6124
			 | 
			
			
				               git stash 
			 | 
		
	
		
			
			| 
				6125
			 | 
			
				6125
			 | 
			
			
				               git checkout master 
			 | 
		
	
		
			
			| 
				6126
			 | 
			
				6126
			 | 
			
			
				               git pull 
			 | 
		
	
		
			
			| 
				6127
			 | 
			
				6127
			 | 
			
			
				               git checkout $GOGS_COMMIT -b $GOGS_COMMIT 
			 | 
		
	
		
			
			| 
				6128
			 | 
			
				6128
			 | 
			
			
				               sed -i "s/Gogs commit.*/Gogs commit:$GOGS_COMMIT/g" $COMPLETION_FILE 
			 | 
		
	
		
			
			| 
				6129
			 | 
			
				
			 | 
			
			
				-              chown -R www-data:www-data /var/www/$GIT_DOMAIN_NAME/htdocs 
			 | 
		
	
		
			
			| 
				6130
			 | 
			
				
			 | 
			
			
				-              cd $GOPATH/src/github.com/gogits/gogs 
			 | 
		
	
		
			
			| 
				6131
			 | 
			
				6129
			 | 
			
			
				               go get -u ./... 
			 | 
		
	
		
			
			| 
				6132
			 | 
			
				6130
			 | 
			
			
				               go build 
			 | 
		
	
		
			
			| 
				6133
			 | 
			
				6131
			 | 
			
			
				               systemctl restart gogs 
			 |