Get the list of OTA updates for a given platform

This commit is contained in:
2024-10-05 19:35:23 +02:00
parent 2feb3f6490
commit d38040cb98
5 changed files with 48 additions and 8 deletions

View File

@ -300,11 +300,14 @@ impl AppConfig {
self.storage_path().join("ota")
}
/// Get the directory that will store OTA updates for a given platform
pub fn ota_platform_dir(&self, platform: OTAPlatform) -> PathBuf {
self.ota_dir().join(platform.to_string())
}
/// Get the path to the file that will contain an OTA update
pub fn path_ota_update(&self, platform: OTAPlatform, version: &semver::Version) -> PathBuf {
self.ota_dir()
.join(platform.to_string())
.join(version.to_string())
self.ota_platform_dir(platform).join(version.to_string())
}
}