Skip to content

Commit

Permalink
quick fix for filesystem initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Oct 8, 2022
1 parent fc057d1 commit 8c94ce9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [3.4.3]

## Fixed

- Fix for new installations with filesystem not initializing

# [3.4.2]

## Added
Expand Down
10 changes: 10 additions & 0 deletions lib/framework/FSPersistence.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ class FSPersistence {
#endif
#endif

// make directories if required, for new IDF4.2 & LittleFS
String path(_filePath);
int index = 0;
while ((index = path.indexOf('/', index + 1)) != -1) {
String segment = path.substring(0, index);
if (!_fs->exists(segment)) {
_fs->mkdir(segment);
}
}

// serialize the data to the file
serializeJson(jsonDocument, settingsFile);
settingsFile.close();
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.4.2"
#define EMSESP_APP_VERSION "3.4.3"

0 comments on commit 8c94ce9

Please sign in to comment.