changed method of fetching license data
This commit is contained in:
		
							parent
							
								
									5aa0eb487e
								
							
						
					
					
						commit
						1b9cbf1bf1
					
				@ -2,8 +2,9 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
require "commands"
 | 
					require "commands"
 | 
				
			||||||
require "cli/parser"
 | 
					require "cli/parser"
 | 
				
			||||||
require "open-uri"
 | 
					 | 
				
			||||||
require "json"
 | 
					require "json"
 | 
				
			||||||
 | 
					require 'net/http'
 | 
				
			||||||
 | 
					require "open-uri"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
module Homebrew
 | 
					module Homebrew
 | 
				
			||||||
  module_function
 | 
					  module_function
 | 
				
			||||||
@ -30,10 +31,10 @@ module Homebrew
 | 
				
			|||||||
  def update_license_data
 | 
					  def update_license_data
 | 
				
			||||||
    update_license_data_args.parse
 | 
					    update_license_data_args.parse
 | 
				
			||||||
    puts "Fetching newest version of SPDX License data..."
 | 
					    puts "Fetching newest version of SPDX License data..."
 | 
				
			||||||
    open(SPDX_DATA_URL) do |json|
 | 
					    resp = Net::HTTP.get_response(URI.parse(SPDX_DATA_URL))
 | 
				
			||||||
      File.open(SPDX_FOLDER_PATH/FILE_NAME, "wb") do |file|
 | 
					
 | 
				
			||||||
        file.write(json.read)
 | 
					    File.open(SPDX_FOLDER_PATH/FILE_NAME, "wb") do |file|
 | 
				
			||||||
      end
 | 
					      file.write(resp.body)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return unless args.fail_if_changed?
 | 
					    return unless args.fail_if_changed?
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user