| 332 | } |
| 333 | |
| 334 | bool deleteCustomAppFile(const String &name) |
| 335 | { |
| 336 | // Create the file name based on the app name |
| 337 | String fileName = "/CUSTOMAPPS/" + name + ".json"; |
| 338 | |
| 339 | // Check if the file exists |
| 340 | if (!LittleFS.exists(fileName)) |
| 341 | { |
| 342 | if (DEBUG_MODE) |
| 343 | DEBUG_PRINTLN("File does not exist: " + fileName + ". No need to delete it"); |
| 344 | return false; |
| 345 | } |
| 346 | |
| 347 | // Delete the file |
| 348 | if (LittleFS.remove(fileName)) |
| 349 | { |
| 350 | if (DEBUG_MODE) |
| 351 | DEBUG_PRINTLN("File removed successfully: " + fileName); |
| 352 | return true; |
| 353 | } |
| 354 | else |
| 355 | { |
| 356 | if (DEBUG_MODE) |
| 357 | DEBUG_PRINTLN("Failed to remove file: " + fileName); |
| 358 | return false; |
| 359 | } |
| 360 | } |
| 361 | |
| 362 | void removeCustomAppFromApps(const String &name, bool setApps) |
| 363 | { |
no outgoing calls
no test coverage detected