(path_to_repo: &Path, file_name: &str, file_contents: &str)
| 193 | } |
| 194 | |
| 195 | pub 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)] |
| 207 | pub fn append_file(path_to_repo: &Path, file_name: &str, file_contents: &str) { |
no outgoing calls