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

Function print_local_json

atomic-cli/src/commands/view/list.rs:775–785  ·  view source on GitHub ↗

The local-source JSON document, printed from wire-carried views — the same document shape the local body emits (repository_root and the current-view marker resolve client-side, exactly like the local path).

(views: &[JsonView], current_view: Option<String>)

Source from the content-addressed store, hash-verified

773/// current-view marker resolve client-side, exactly like the local
774/// path).
775pub(crate) fn print_local_json(views: &[JsonView], current_view: Option<String>) -> CliResult<()> {
776 let repo_root = crate::commands::find_repository_root()?;
777 print_json(&JsonViewList {
778 schema_version: VIEW_LIST_JSON_SCHEMA_VERSION,
779 source: "local",
780 repository_root: Some(repo_root.to_string_lossy().into_owned()),
781 remote: None,
782 current_view,
783 views: views.to_vec(),
784 })
785}
786
787// Tests
788

Callers 1

view_listFunction · 0.85

Calls 2

find_repository_rootFunction · 0.85
print_jsonFunction · 0.70

Tested by

no test coverage detected