bump-formula-pr: handle url with specs hash
The existing `bump-formula-pr` regexes expect a `url` string to only be followed by a newline. However, `url` also accepts a `specs` hash, which can appear after the `url` string. For example: ``` url "https://www.example.com/1.2.3.tar.gz", using: :homebrew_curl ``` This commit modifies the regexes to capture anything after the `url` string and before the newline. This works for the aforementioned example, where the trailing hash is on the same line, but it won't work if the hash appears on a subsequent line. For example: ``` url "https://www.example.com/1.2.3.tar.gz", using: :homebrew_curl ```
This commit is contained in:
		
							parent
							
								
									f1d04b4c3d
								
							
						
					
					
						commit
						283ff9e3ad
					
				@ -275,7 +275,7 @@ module Homebrew
 | 
			
		||||
 | 
			
		||||
    if new_mirrors.present?
 | 
			
		||||
      replacement_pairs << [
 | 
			
		||||
        /^( +)(url "#{Regexp.escape(new_url)}"\n)/m,
 | 
			
		||||
        /^( +)(url "#{Regexp.escape(new_url)}"[^\n]*?\n)/m,
 | 
			
		||||
        "\\1\\2\\1mirror \"#{new_mirrors.join("\"\n\\1mirror \"")}\"\n",
 | 
			
		||||
      ]
 | 
			
		||||
    end
 | 
			
		||||
@ -293,7 +293,7 @@ module Homebrew
 | 
			
		||||
        ]
 | 
			
		||||
      elsif new_url.present?
 | 
			
		||||
        [
 | 
			
		||||
          /^( +)(url "#{Regexp.escape(new_url)}"\n)/m,
 | 
			
		||||
          /^( +)(url "#{Regexp.escape(new_url)}"[^\n]*?\n)/m,
 | 
			
		||||
          "\\1\\2\\1version \"#{new_version}\"\n",
 | 
			
		||||
        ]
 | 
			
		||||
      elsif new_revision.present?
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user