MCPcopy Create free account
hub / github.com/dashed/git-chain / create_new_file

Function create_new_file

tests/common/mod.rs:195–204  ·  view source on GitHub ↗
(path_to_repo: &Path, file_name: &str, file_contents: &str)

Source from the content-addressed store, hash-verified

193}
194
195pub fn create_new_file(path_to_repo: &Path, file_name: &str, file_contents: &str) {
196 let mut file = OpenOptions::new()
197 .write(true)
198 .create(true)
199 .truncate(true)
200 .open(path_to_repo.join(file_name))
201 .unwrap();
202
203 writeln!(file, "{}", file_contents).unwrap();
204}
205
206#[allow(dead_code)]
207pub fn append_file(path_to_repo: &Path, file_name: &str, file_contents: &str) {

Calls

no outgoing calls