(dir_path: &Path, chart_name: &str)
| 643 | } |
| 644 | |
| 645 | fn create_helm_diff_file(dir_path: &Path, chart_name: &str) -> anyhow::Result<BufWriter<File>> { |
| 646 | use std::fs::{self, OpenOptions}; |
| 647 | |
| 648 | let filepath = { |
| 649 | let filepath = dir_path.join("helm-diffs"); |
| 650 | if !filepath.exists() { |
| 651 | fs::create_dir_all(&filepath)?; |
| 652 | } |
| 653 | filepath.join(format!("{chart_name}.diff")) |
| 654 | }; |
| 655 | |
| 656 | let file = OpenOptions::new() |
| 657 | .write(true) |
| 658 | .create(true) |
| 659 | .truncate(true) // This will ensure the content is overridden |
| 660 | .open(filepath)?; |
| 661 | |
| 662 | Ok(BufWriter::new(file)) |
| 663 | } |
no test coverage detected