diff --git a/Planet/Entities/MyArticleModel+Save.swift b/Planet/Entities/MyArticleModel+Save.swift index 99befe87..748ad4c7 100644 --- a/Planet/Entities/MyArticleModel+Save.swift +++ b/Planet/Entities/MyArticleModel+Save.swift @@ -54,6 +54,11 @@ extension MyArticleModel { var marks: OrderedDictionary = ["Started": started] removeDSStore() + + if !FileManager.default.fileExists(atPath: publicBasePath.path) { + try FileManager.default.createDirectory(at: publicBasePath, withIntermediateDirectories: true) + } + saveMarkdownInBackground() try processContent() diff --git a/Planet/Entities/MyPlanetModel.swift b/Planet/Entities/MyPlanetModel.swift index 894232d8..b636d99b 100644 --- a/Planet/Entities/MyPlanetModel.swift +++ b/Planet/Entities/MyPlanetModel.swift @@ -1461,6 +1461,9 @@ class MyPlanetModel: Equatable, Hashable, Identifiable, ObservableObject, Codabl guard let template = template else { throw PlanetError.MissingTemplateError } + if !FileManager.default.fileExists(atPath: publicBasePath.path) { + try FileManager.default.createDirectory(at: publicBasePath, withIntermediateDirectories: true) + } if FileManager.default.fileExists(atPath: publicAssetsPath.path) { try FileManager.default.removeItem(at: publicAssetsPath) }