| 209 | } |
| 210 | |
| 211 | static void registerInstalledApp(std::string path) { |
| 212 | LOGGER.info("Registering app at {}", path); |
| 213 | std::string manifest_path = path + "/manifest.properties"; |
| 214 | if (!file::isFile(manifest_path)) { |
| 215 | LOGGER.error("Manifest not found at {}", manifest_path); |
| 216 | return; |
| 217 | } |
| 218 | |
| 219 | std::map<std::string, std::string> properties; |
| 220 | if (!file::loadPropertiesFile(manifest_path, properties)) { |
| 221 | LOGGER.error("Failed to load manifest at {}", manifest_path); |
| 222 | return; |
| 223 | } |
| 224 | |
| 225 | app::AppManifest manifest; |
| 226 | if (!app::parseManifest(properties, manifest)) { |
| 227 | LOGGER.error("Failed to parse manifest at {}", manifest_path); |
| 228 | return; |
| 229 | } |
| 230 | |
| 231 | manifest.appCategory = app::Category::User; |
| 232 | manifest.appLocation = app::Location::external(path); |
| 233 | |
| 234 | app::addAppManifest(manifest); |
| 235 | } |
| 236 | |
| 237 | static void registerInstalledApps(const std::string& path) { |
| 238 | LOGGER.info("Registering apps from {}", path); |
no test coverage detected