Skip to content

Commit

Permalink
Generate a pretty ext/puppet_agent_components.json file
Browse files Browse the repository at this point in the history
This help review what is changed in pull requests that update this file
using `bundle exec rake puppet_versions:update`.
  • Loading branch information
smortex committed Aug 4, 2024
1 parent 56c2f65 commit 948c5d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ namespace :puppet_versions do
require 'net/http'
require 'net/https'
require 'uri'
require 'json'

uri = URI.parse('https://forgeapi.puppet.com/private/versions/puppet-agent')
http = Net::HTTP.new(uri.host, uri.port)
Expand All @@ -31,7 +32,7 @@ namespace :puppet_versions do
raise unless response.is_a?(Net::HTTPSuccess)

File.open(PUPPET_VERSIONS_PATH, 'wb:UTF-8') do |fd|
fd.write(response.body)
fd.write(JSON.pretty_generate(JSON.parse(response.body)))
end
end

Expand Down

0 comments on commit 948c5d8

Please sign in to comment.