summaryrefslogtreecommitdiff
path: root/cli/tools/registry/tar.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tools/registry/tar.rs')
-rw-r--r--cli/tools/registry/tar.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/tools/registry/tar.rs b/cli/tools/registry/tar.rs
index a8519fe02..2dd160a0a 100644
--- a/cli/tools/registry/tar.rs
+++ b/cli/tools/registry/tar.rs
@@ -25,7 +25,9 @@ use super::unfurl::SpecifierUnfurler;
#[derive(Debug, Clone, PartialEq)]
pub struct PublishableTarballFile {
+ pub path_str: String,
pub specifier: Url,
+ pub hash: String,
pub size: usize,
}
@@ -153,7 +155,10 @@ pub fn create_gzipped_tarball(
diagnostics_collector,
)?;
files.push(PublishableTarballFile {
+ path_str: path_str.clone(),
specifier: specifier.clone(),
+ // This hash string matches the checksum computed by registry
+ hash: format!("sha256-{:x}", sha2::Sha256::digest(&content)),
size: content.len(),
});
tar