forked from lix-project/lix-installer
APFS volumes don't necessarily have names (#490)
This commit is contained in:
parent
d47968d982
commit
f91b93bdb0
|
@ -32,7 +32,7 @@ impl CreateApfsVolume {
|
||||||
plist::from_bytes(&output.stdout).map_err(Self::error)?;
|
plist::from_bytes(&output.stdout).map_err(Self::error)?;
|
||||||
for container in parsed.containers {
|
for container in parsed.containers {
|
||||||
for volume in container.volumes {
|
for volume in container.volumes {
|
||||||
if volume.name == name {
|
if volume.name.as_ref() == Some(&name) {
|
||||||
return Ok(StatefulAction::completed(Self {
|
return Ok(StatefulAction::completed(Self {
|
||||||
disk: disk.as_ref().to_path_buf(),
|
disk: disk.as_ref().to_path_buf(),
|
||||||
name,
|
name,
|
||||||
|
|
|
@ -83,7 +83,7 @@ impl EncryptApfsVolume {
|
||||||
plist::from_bytes(&output.stdout).map_err(Self::error)?;
|
plist::from_bytes(&output.stdout).map_err(Self::error)?;
|
||||||
for container in parsed.containers {
|
for container in parsed.containers {
|
||||||
for volume in container.volumes {
|
for volume in container.volumes {
|
||||||
if volume.name == name {
|
if volume.name.as_ref() == Some(&name) {
|
||||||
match volume.encryption == false {
|
match volume.encryption == false {
|
||||||
true => {
|
true => {
|
||||||
return Ok(StatefulAction::completed(Self { disk, name }));
|
return Ok(StatefulAction::completed(Self { disk, name }));
|
||||||
|
|
|
@ -23,6 +23,6 @@ pub struct DiskUtilApfsContainer {
|
||||||
#[derive(serde::Deserialize, Clone, Debug)]
|
#[derive(serde::Deserialize, Clone, Debug)]
|
||||||
#[serde(rename_all = "PascalCase")]
|
#[serde(rename_all = "PascalCase")]
|
||||||
pub struct DiskUtilApfsListVolume {
|
pub struct DiskUtilApfsListVolume {
|
||||||
pub name: String,
|
pub name: Option<String>,
|
||||||
pub encryption: bool,
|
pub encryption: bool,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue