(file_path: &str, content: &str)
| 96 | } |
| 97 | |
| 98 | pub fn prepend(file_path: &str, content: &str) -> Result<()> { |
| 99 | modify_file_msg(&format!("{:#?}", &file_path)); |
| 100 | |
| 101 | let (file_path, file_contents) = read(file_path)?; |
| 102 | |
| 103 | let mut new_content = String::new(); |
| 104 | new_content.push_str(content); |
| 105 | new_content.push('\n'); |
| 106 | new_content.push_str(file_contents.as_str()); |
| 107 | |
| 108 | std::fs::write(file_path, new_content)?; |
| 109 | |
| 110 | Ok(()) |
| 111 | } |
| 112 | |
| 113 | /* |
| 114 | /// Try to create files via the template-* folders for plugins |
no test coverage detected