MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / show

Method show

atomic-cli/src/commands/repo.rs:71–98  ·  view source on GitHub ↗
(root: &std::path::Path, json: bool)

Source from the content-addressed store, hash-verified

69
70impl Repo {
71 fn show(root: &std::path::Path, json: bool) -> CliResult<()> {
72 let service = Service::open_root(root)?.ok_or_else(|| CliError::InvalidArgument {
73 message: "repository identity inspection requires a local repository service".into(),
74 })?;
75 let record = service.get_project_identity(pb::GetProjectIdentityRequest {
76 repository: Some(service.reference.clone()),
77 })?;
78 if json {
79 println!(
80 "{}",
81 serde_json::to_string_pretty(&serde_json::json!({
82 "project": record.project, "urn": record.urn, "created": record.created,
83 "minted": record.minted, "signed_by": record.signed_by, "hash": record.hash,
84 }))
85 .expect("JSON serialization")
86 );
87 } else {
88 println!(
89 "project: {}\nurn: {}\ncreated: {}\nminted: {}\nsigned by: {}",
90 record.project,
91 record.urn,
92 record.created,
93 record.minted,
94 record.signed_by.as_deref().unwrap_or("unsigned")
95 );
96 }
97 Ok(())
98 }
99
100 /// `repo identity adopt` — fetch the remote binding and force-adopt it.
101 fn adopt(root: &std::path::Path, remote: Option<&str>, json: bool) -> CliResult<()> {

Callers

nothing calls this directly

Calls 2

get_project_identityMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected