fix(macos): satisfy swiftformat

This commit is contained in:
Peter Steinberger
2025-12-14 05:15:39 +00:00
parent a48aebc78c
commit 4970af6bb9

View File

@@ -166,14 +166,16 @@ enum PiOAuthStore {
attributes: [.posixPermissions: 0o700]) attributes: [.posixPermissions: 0o700])
let url = self.oauthURL() let url = self.oauthURL()
let data = try JSONSerialization.data(withJSONObject: storage, options: [.prettyPrinted, .sortedKeys]) let data = try JSONSerialization.data(
withJSONObject: storage,
options: [.prettyPrinted, .sortedKeys])
try data.write(to: url, options: [.atomic]) try data.write(to: url, options: [.atomic])
try FileManager.default.setAttributes([.posixPermissions: 0o600], ofItemAtPath: url.path) try FileManager.default.setAttributes([.posixPermissions: 0o600], ofItemAtPath: url.path)
} }
} }
extension Data { extension Data {
fileprivate func base64URLEncodedString() -> String { private func base64URLEncodedString() -> String {
self.base64EncodedString() self.base64EncodedString()
.replacingOccurrences(of: "+", with: "-") .replacingOccurrences(of: "+", with: "-")
.replacingOccurrences(of: "/", with: "_") .replacingOccurrences(of: "/", with: "_")