mirror of
https://codeberg.org/icewind/haze.git
synced 2026-10-01 08:44:09 +02:00
feat(clean): Add more context to errors
Signed-off-by: Louis Chmn <louis@chmn.me>
This commit is contained in:
parent
9dfaf4b27d
commit
28baa84262
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?;
|
||||
|
||||
for cache_dir in config.work_dir.read_dir().into_diagnostic()? {
|
||||
let cache_dir = cache_dir.into_diagnostic()?;
|
||||
for cache_dir in config
|
||||
.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()
|
||||
&& id.starts_with("haze-")
|
||||
&& !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 } => {
|
||||
let list = Cloud::list(&docker, filter, &config).await?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue