From ff40a441fc7bf92992ff760ebdbff8d3e494d13f Mon Sep 17 00:00:00 2001 From: Schneems Date: Sat, 21 Sep 2024 08:55:59 -0500 Subject: [PATCH] Style URLs --- .../ruby/src/layers/metrics_agent_install.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/buildpacks/ruby/src/layers/metrics_agent_install.rs b/buildpacks/ruby/src/layers/metrics_agent_install.rs index 6d0b4973..2543f843 100644 --- a/buildpacks/ruby/src/layers/metrics_agent_install.rs +++ b/buildpacks/ruby/src/layers/metrics_agent_install.rs @@ -1,6 +1,6 @@ use crate::{RubyBuildpack, RubyBuildpackError}; use bullet_stream::state::SubBullet; -use bullet_stream::Print; +use bullet_stream::{style, Print}; use flate2::read::GzDecoder; use libcnb::additional_buildpack_binary_path; use libcnb::data::layer_name; @@ -75,9 +75,15 @@ pub(crate) fn handle_metrics_agent_layer( invalid_metadata_action: &|_| InvalidMetadataAction::DeleteLayer, restored_layer_action: &|old: &Metadata, _| { if old == &metadata { - (RestoredLayerAction::KeepLayer, old.download_url.clone()) + ( + RestoredLayerAction::KeepLayer, + style::url(old.download_url.clone()), + ) } else { - (RestoredLayerAction::DeleteLayer, old.download_url.clone()) + ( + RestoredLayerAction::DeleteLayer, + style::url(old.download_url.clone()), + ) } }, }, @@ -100,8 +106,8 @@ pub(crate) fn handle_metrics_agent_layer( let bin_dir = layer_ref.path().join("bin"); let timer = bullet.start_timer(format!( - "Installing metrics agent from {}", - metadata.download_url + "Installing metrics agent from {url}", + url = style::url(&metadata.download_url) )); let agentmon = install_agentmon(&bin_dir, &metadata) .map_err(RubyBuildpackError::MetricsAgentError)?;