Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear the proto store before installing dependencies #183

Merged
merged 5 commits into from
Dec 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Recreate the vendor directory
  • Loading branch information
mara-schulke committed Dec 6, 2023
commit 38e0327b0bd0d7444bfb5f5da1419cd166beece4
4 changes: 3 additions & 1 deletion src/package/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ impl PackageStore {
pub async fn clear(&self) -> miette::Result<()> {
let path = self.proto_vendor_path();
match fs::remove_dir_all(&path).await {
Ok(()) => Ok(()),
Ok(()) => fs::create_dir(&path)
.await
.map_err(|_| miette!("failed to reinitialize {path:?} directory after cleaning")),
Err(err) if matches!(err.kind(), std::io::ErrorKind::NotFound) => {
Err(miette!("directory {path:?} not found"))
}
Expand Down
Loading