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

Function write

atomic-cli/tests/review_view.rs:22–35  ·  view source on GitHub ↗
(repo: &Repository, path: &str, text: &str)

Source from the content-addressed store, hash-verified

20 .to_base32()
21}
22fn write(repo: &Repository, path: &str, text: &str) {
23 let full = repo.root().join(path);
24 std::fs::create_dir_all(full.parent().unwrap()).unwrap();
25 let tracked = full.exists();
26 std::fs::write(full, text).unwrap();
27 if !tracked {
28 repo.add(
29 repo.require_working_copy_id().unwrap(),
30 path,
31 TrackingOptions::default(),
32 )
33 .unwrap();
34 }
35}
36
37fn command(root: &Path) -> Command {
38 let mut command = Command::new(env!("CARGO_BIN_EXE_atomic"));

Calls 6

parentMethod · 0.80
rootMethod · 0.45
unwrapMethod · 0.45
existsMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected