(workspace: &Workspace)
| 607 | } |
| 608 | |
| 609 | async fn re_create_firedbg_folder(workspace: &Workspace) -> Result<()> { |
| 610 | let firedbg_directory = &workspace.get_firedbg_dir(); |
| 611 | let paths: Vec<_> = glob(&format!("{}/*", firedbg_directory))? |
| 612 | .filter_map(Result::ok) |
| 613 | .collect(); |
| 614 | for path in paths { |
| 615 | if path.is_dir() && path.ends_with("firedbg/target") { |
| 616 | // Keep the FireDBG target directory |
| 617 | continue; |
| 618 | } else if path.is_dir() { |
| 619 | remove_dir_all(&path) |
| 620 | .await |
| 621 | .with_context(|| format!("Fail to delete directory: `{}`", path.display()))?; |
| 622 | } else if path.is_file() { |
| 623 | remove_file(&path) |
| 624 | .await |
| 625 | .with_context(|| format!("Fail to delete file: `{}`", path.display()))?; |
| 626 | } |
| 627 | } |
| 628 | pin_firedbg_version(workspace) |
| 629 | .await |
| 630 | .context("Fail to pin FireDBG version")?; |
| 631 | Ok(()) |
| 632 | } |
| 633 | |
| 634 | async fn check_firedbg_version_updated(workspace: &Workspace) -> Result<()> { |
| 635 | let current_version = current_firedbg_version(); |
no test coverage detected