mirror of
https://codeberg.org/icewind/haze.git
synced 2026-10-01 08:44:09 +02:00
Merge pull request 'feat(clean): Add more context to errors' (#56) from artonge/haze:artonge/feat/increase_error_context into main
Reviewed-on: https://codeberg.org/icewind/haze/pulls/56
This commit is contained in:
commit
c7f86bad43
1 changed files with 10 additions and 3 deletions
13
src/main.rs
13
src/main.rs
|
|
@ -93,8 +93,15 @@ async fn main() -> Result<ExitCode> {
|
||||||
|
|
||||||
clear_networks(&docker, &retain).await?;
|
clear_networks(&docker, &retain).await?;
|
||||||
|
|
||||||
for cache_dir in config.work_dir.read_dir().into_diagnostic()? {
|
for cache_dir in config
|
||||||
let cache_dir = cache_dir.into_diagnostic()?;
|
.work_dir
|
||||||
|
.read_dir()
|
||||||
|
.into_diagnostic()
|
||||||
|
.wrap_err_with(|| format!("Failed to read dir {}", config.work_dir))?
|
||||||
|
{
|
||||||
|
let cache_dir = cache_dir
|
||||||
|
.into_diagnostic()
|
||||||
|
.wrap_err_with(|| "Failed to unwrap cache_dir")?;
|
||||||
if let Some(id) = cache_dir.file_name().to_str()
|
if let Some(id) = cache_dir.file_name().to_str()
|
||||||
&& id.starts_with("haze-")
|
&& id.starts_with("haze-")
|
||||||
&& !retain.iter().any(|cloud| cloud.id == id)
|
&& !retain.iter().any(|cloud| cloud.id == id)
|
||||||
|
|
@ -117,7 +124,7 @@ async fn main() -> Result<ExitCode> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
prune_worktrees(&config)?;
|
prune_worktrees(&config).wrap_err_with(|| "Failed to prune worktree")?;
|
||||||
}
|
}
|
||||||
HazeArgs::List { filter } => {
|
HazeArgs::List { filter } => {
|
||||||
let list = Cloud::list(&docker, filter, &config).await?;
|
let list = Cloud::list(&docker, filter, &config).await?;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue