Skip to content

Commit

Permalink
Style URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
schneems committed Sep 21, 2024
1 parent 6fd59ee commit ff40a44
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions buildpacks/ruby/src/layers/metrics_agent_install.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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()),
)
}
},
},
Expand All @@ -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)?;
Expand Down

0 comments on commit ff40a44

Please sign in to comment.