feat: Updates dependencies and cli commands to be async.

This commit is contained in:
2024-12-21 00:07:01 -05:00
parent b7ac6ee9d1
commit 59bc977788
10 changed files with 185 additions and 195 deletions

View File

@@ -9,14 +9,14 @@ import Foundation
/// - Parameters:
/// - operation: The operation to run with the temporary directory.
public func withTemporaryDirectory(
_ operation: (URL) throws -> Void
) rethrows {
_ operation: (URL) async throws -> Void
) async rethrows {
let tempUrl = FileManager.default
.temporaryDirectory
.appendingPathComponent(UUID().uuidString)
try! FileManager.default.createDirectory(at: tempUrl, withIntermediateDirectories: false)
try operation(tempUrl)
try await operation(tempUrl)
try! FileManager.default.removeItem(at: tempUrl)
}