From 5ec5acb31270c109736a60b812ab9551aa6fecea Mon Sep 17 00:00:00 2001 From: Runar Hummelsund Date: Sun, 28 Nov 2021 13:05:25 +0100 Subject: [PATCH] Add Folder.applicationSupport --- README.md | 1 + Sources/Files.swift | 5 +++++ Tests/FilesTests/FilesTests.swift | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 316f6b5..76f1208 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,7 @@ Folder.library Folder.temporary Folder.home Folder.documents +Folder.applicationSupport ``` ## Installation diff --git a/Sources/Files.swift b/Sources/Files.swift index 830f1ba..7ac00c5 100644 --- a/Sources/Files.swift +++ b/Sources/Files.swift @@ -926,6 +926,11 @@ public extension Folder { static var library: Folder? { return try? .matching(.libraryDirectory) } + + /// The current user's Application Support folder + static var applicationSupport: Folder? { + return try? .matching(.applicationSupportDirectory) + } } #endif diff --git a/Tests/FilesTests/FilesTests.swift b/Tests/FilesTests/FilesTests.swift index 040f60e..b3f6fc7 100644 --- a/Tests/FilesTests/FilesTests.swift +++ b/Tests/FilesTests/FilesTests.swift @@ -950,6 +950,10 @@ extension FilesTests { func testAccessingLibraryFolder() { XCTAssertNotNil(Folder.library, "Library folder should be available.") } + + func testAccessingApplicationSupportFolder() { + XCTAssertNotNil(Folder.applicationSupport, "Application support folder should be available.") + } func testResolvingFolderMatchingSearchPath() { performTest {