Skip to content

Commit 047891f

Browse files
feat: Change naming of manifest file. (#226)
This updates the naming to use `ArtifactId::as_file_name`. Signed-off-by: Andrew Lilley Brinker <[email protected]>
1 parent 004bc36 commit 047891f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

omnibor-cli/src/cmd/manifest/create.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,5 @@ fn manifest_file_path(output: Option<&Path>, target_aid: ArtifactId<Sha256>) ->
9797
},
9898
};
9999

100-
let file_name = format!("{}.manifest", target_aid.as_hex());
101-
102-
Ok(pathbuf![&dir, &file_name])
100+
Ok(pathbuf![&dir, &target_aid.as_file_name()])
103101
}

omnibor/src/artifact_id.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,11 @@ impl<H: SupportedHash> ArtifactId<H> {
336336
///
337337
/// What that means for us is that the `:` separator character is
338338
/// replaced with `_`.
339-
pub fn safe_name(&self) -> PathBuf {
340-
self.gitoid.url().to_string().replace(':', "_").into()
339+
pub fn as_file_name(&self) -> PathBuf {
340+
let name = self.gitoid.url().to_string().replace(':', "_");
341+
let mut path = PathBuf::from(name);
342+
path.set_extension("manifest");
343+
path
341344
}
342345

343346
/// Get the underlying bytes of the [`ArtifactId`] hash.

0 commit comments

Comments
 (0)