Skip to content

Commit

Permalink
trailing spaces
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Simmons <sean.simmons@progress.com>
  • Loading branch information
sean-simmons-progress committed Sep 18, 2024
1 parent 5fe3711 commit cc7a44f
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,41 +230,33 @@ class InvalidChannelName < StandardError; end
# Legacy params which affect the default channel
param :prerelease, Boolean
param :nightlies, Boolean

param :channel, String, default: lambda {
if params['prerelease'] || params['nightlies']
'current'
else
'stable'
end
}

param :project, String, in: Chef::Cache::KNOWN_PROJECTS, required: true
param :p, String, required: true
param :pv, String, required: true
param :m, String, required: true

# Get package information
package_info = get_package_info

# Original URL from package info
original_url = package_info["url"]

# Check if the URL needs to be rewritten for Amazon Linux 2
if original_url.include?("/amazon/2023/") && params[:pv] == "2"
# Rewrite the URL for Amazon Linux 2
rewritten_url = original_url
.gsub(/\/amazon\/2023\//, "/amazon/2/")
.gsub(/-amazon2023/, "-amazon2")
.gsub(/.amazon2023/, ".amazon2")

# Update the package_info with the rewritten URL
package_info["url"] = rewritten_url

# Debug output of the rewritten URL
# puts "Debug Info - Rewritten Metadata URL: #{rewritten_url}"
end

# Respond with the updated package stuff
if request.accept? 'text/plain'
parse_plain_text(package_info)
Expand Down

0 comments on commit cc7a44f

Please sign in to comment.