mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
only remove if exists
This commit is contained in:
committed by
Aiden McClelland
parent
c9676ff018
commit
8ef1584a4d
@@ -89,9 +89,11 @@ async fn setup_or_init(cfg_path: Option<&str>) -> Result<(), Error> {
|
||||
DEFAULT_PASSWORD,
|
||||
)
|
||||
.await?;
|
||||
tokio::fs::remove_file(REPAIR_DISK_PATH)
|
||||
.await
|
||||
.with_ctx(|_| (embassy::ErrorKind::Filesystem, REPAIR_DISK_PATH))?;
|
||||
if tokio::fs::metadata(REPAIR_DISK_PATH).await.is_ok() {
|
||||
tokio::fs::remove_file(REPAIR_DISK_PATH)
|
||||
.await
|
||||
.with_ctx(|_| (embassy::ErrorKind::Filesystem, REPAIR_DISK_PATH))?;
|
||||
}
|
||||
tracing::info!("Loaded Disk");
|
||||
embassy::init::init(&cfg, &get_product_key().await?).await?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user