Can delete an OTA update

This commit is contained in:
2024-10-08 22:22:57 +02:00
parent 2e4a2b68dd
commit eafa8e6a4b
5 changed files with 79 additions and 8 deletions

View File

@ -31,6 +31,13 @@ pub fn get_ota_update(platform: OTAPlatform, version: &semver::Version) -> anyho
Ok(std::fs::read(path)?)
}
/// Delete an OTA update
pub fn delete_update(platform: OTAPlatform, version: &semver::Version) -> anyhow::Result<()> {
let path = AppConfig::get().path_ota_update(platform, version);
std::fs::remove_file(path)?;
Ok(())
}
/// Get the list of OTA software updates for a platform
pub fn get_ota_updates_for_platform(platform: OTAPlatform) -> anyhow::Result<Vec<OTAUpdate>> {
let ota_path = AppConfig::get().ota_platform_dir(platform);