[FL-3883] Remove internal storage folder if corresponding flag set (#3824)

* Remove the .int directory when the flag is set
* Improve error handling and variable naming
* Cleanup the code
* Fix updater build

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Georgii Surkov
2024-08-09 07:40:42 +01:00
committed by GitHub
parent 741329a743
commit 235cb649a6
4 changed files with 98 additions and 22 deletions

View File

@@ -1,7 +1,9 @@
#include "storage_processing.h"
#include <m-list.h>
#include <m-dict.h>
#include "storage_processing.h"
#include "storage_internal_dirname_i.h"
#define TAG "Storage"
#define STORAGE_PATH_PREFIX_LEN 4u
@@ -555,9 +557,9 @@ void storage_process_alias(
} else if(furi_string_start_with(path, STORAGE_INT_PATH_PREFIX)) {
furi_string_replace_at(
path, 0, strlen(STORAGE_INT_PATH_PREFIX), STORAGE_EXT_PATH_PREFIX "/.int");
path, 0, strlen(STORAGE_INT_PATH_PREFIX), EXT_PATH(STORAGE_INTERNAL_DIR_NAME));
FuriString* int_on_ext_path = furi_string_alloc_set(STORAGE_EXT_PATH_PREFIX "/.int");
FuriString* int_on_ext_path = furi_string_alloc_set(EXT_PATH(STORAGE_INTERNAL_DIR_NAME));
if(storage_process_common_stat(app, int_on_ext_path, NULL) != FSE_OK) {
storage_process_common_mkdir(app, int_on_ext_path);
}