(path: &Path, content: &str)
| 112 | } |
| 113 | |
| 114 | pub(crate) fn write_file(path: &Path, content: &str) { |
| 115 | if let Some(parent) = path.parent() { |
| 116 | if let Err(err) = fs::create_dir_all(parent) { |
| 117 | panic!("failed to create {}: {err}", parent.display()); |
| 118 | } |
| 119 | } |
| 120 | if let Err(err) = fs::write(path, content) { |
| 121 | panic!("failed to write {}: {err}", path.display()); |
| 122 | } |
| 123 | } |
| 124 | |
| 125 | pub(crate) async fn setup_project(project_root: &Path) -> TraceDecay { |
| 126 | write_file( |