Skip to content

Commit

Permalink
Use the skipped helper
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamc committed Nov 19, 2024
1 parent 81c4d0e commit b242303
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/action/macos/unmount_apfs_volume.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,20 @@ impl UnmountApfsVolume {
) -> Result<StatefulAction<Self>, ActionError> {
let diskinfo = DiskUtilInfoOutput::for_volume_name(&name).await;

let mut task = Self::plan(&disk, name).await?;
let task = Self {
disk: disk.as_ref().to_owned(),
name,
};

if let Ok(diskinfo) = diskinfo {
if Path::new(&diskinfo.parent_whole_disk) == disk.as_ref()
&& diskinfo.mount_point.as_deref() == Some("/nix".as_ref())
{
task.state = crate::action::ActionState::Skipped
return Ok(StatefulAction::skipped(task));
}
}

Ok(task)
Ok(task.into())
}
}

Expand Down

0 comments on commit b242303

Please sign in to comment.