mirror of
https://github.com/sparkle-project/Sparkle
synced 2026-11-28 05:14:34 +00:00
Bump minimum deployment target to 12.0 (#2883)
To support building Sparkle in Xcode 27 (beta 1), we need to bump the deployment target.
This commit is contained in:
17 files changed
+96
-234
No files matched your search
+11
-17
@@ -62,24 +62,18 @@ enum DecodeSecretStringError : LocalizedError {
|
||||
|
||||
// Reads secret base64 string from a file
|
||||
func decodeSecretString(filePath: String) throws -> String {
|
||||
let privateKeyString: String
|
||||
if #available(macOS 10.15.4, *) {
|
||||
// Prefer to use FileHandle which supports process substitution:
|
||||
// https://github.com/sparkle-project/Sparkle/issues/2605
|
||||
let fileHandle = try FileHandle(forReadingFrom: URL(fileURLWithPath: filePath))
|
||||
|
||||
guard let data = try fileHandle.readToEnd() else {
|
||||
throw DecodeSecretStringError.unableToReadData
|
||||
}
|
||||
|
||||
guard let decodedPrivateKeyString = String(data: data, encoding: .utf8) else {
|
||||
throw DecodeSecretStringError.unableToDecodeDataAsUTF8String
|
||||
}
|
||||
|
||||
privateKeyString = decodedPrivateKeyString
|
||||
} else {
|
||||
privateKeyString = try String(contentsOf: URL(fileURLWithPath: filePath))
|
||||
// Use FileHandle because it supports process substitution:
|
||||
// https://github.com/sparkle-project/Sparkle/issues/2605
|
||||
let fileHandle = try FileHandle(forReadingFrom: URL(fileURLWithPath: filePath))
|
||||
|
||||
guard let data = try fileHandle.readToEnd() else {
|
||||
throw DecodeSecretStringError.unableToReadData
|
||||
}
|
||||
|
||||
guard let decodedPrivateKeyString = String(data: data, encoding: .utf8) else {
|
||||
throw DecodeSecretStringError.unableToDecodeDataAsUTF8String
|
||||
}
|
||||
|
||||
let privateKeyString = decodedPrivateKeyString
|
||||
return privateKeyString.trimmingCharacters(in: .whitespacesAndNewlines)
|
||||
}
|
||||
Reference in new issue
Block a user