mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 04:01:58 +00:00
do not error if cannot determine live usb device (#1986)
This commit is contained in:
@@ -37,7 +37,9 @@ pub fn disk() -> Result<(), Error> {
|
|||||||
|
|
||||||
#[command(display(display_none))]
|
#[command(display(display_none))]
|
||||||
pub async fn list() -> Result<Vec<DiskInfo>, Error> {
|
pub async fn list() -> Result<Vec<DiskInfo>, Error> {
|
||||||
let skip = Path::new(
|
let skip = match async {
|
||||||
|
Ok::<_, Error>(
|
||||||
|
Path::new(
|
||||||
&String::from_utf8(
|
&String::from_utf8(
|
||||||
Command::new("grub-probe-default")
|
Command::new("grub-probe-default")
|
||||||
.arg("-t")
|
.arg("-t")
|
||||||
@@ -48,11 +50,22 @@ pub async fn list() -> Result<Vec<DiskInfo>, Error> {
|
|||||||
)?
|
)?
|
||||||
.trim(),
|
.trim(),
|
||||||
)
|
)
|
||||||
.to_owned();
|
.to_owned(),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
Ok(a) => Some(a),
|
||||||
|
Err(e) => {
|
||||||
|
tracing::error!("Could not determine live usb device: {}", e);
|
||||||
|
tracing::debug!("{:?}", e);
|
||||||
|
None
|
||||||
|
}
|
||||||
|
};
|
||||||
Ok(crate::disk::util::list(&Default::default())
|
Ok(crate::disk::util::list(&Default::default())
|
||||||
.await?
|
.await?
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|i| &*i.logicalname != skip)
|
.filter(|i| Some(&*i.logicalname) != skip.as_deref())
|
||||||
.collect())
|
.collect())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user