Skip to content

Commit 88ee7b6

Browse files
authored
Lower Apple Platform requirement in Package.swift (#102)
* Lower Apple Platform requirement in Package.swift * Update TemporaryGettingStarted.md to match version
1 parent 3767654 commit 88ee7b6

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

Package.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ let package = Package(
1717
name: "swift-testing",
1818

1919
platforms: [
20-
.macOS(.v13),
21-
.iOS(.v16),
22-
.watchOS(.v9),
23-
.tvOS(.v16),
20+
.macOS(.v10_15),
21+
.iOS(.v13),
22+
.watchOS(.v6),
23+
.tvOS(.v13),
24+
.macCatalyst(.v13),
2425
.visionOS(.v1),
2526
],
2627

Sources/GitStatus/main.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,17 @@ func _runGit(passing arguments: String..., readingUpToCount maxOutputCount: Int)
5656
defer {
5757
process.terminate()
5858
}
59-
guard let output = try? stdoutPipe.fileHandleForReading.read(upToCount: maxOutputCount) else {
60-
return nil
59+
if #available(macOS 10.15.4, *) {
60+
guard let output = try? stdoutPipe.fileHandleForReading.read(upToCount: maxOutputCount) else {
61+
return nil
62+
}
63+
return String(data: output, encoding: .utf8)
64+
} else {
65+
guard let output = try? stdoutPipe.fileHandleForReading.readData(ofLength: maxOutputCount) else {
66+
return nil
67+
}
68+
return String(data: output, encoding: .utf8)
6169
}
62-
return String(data: output, encoding: .utf8)
6370
#else
6471
return nil
6572
#endif

Sources/Testing/Testing.docc/TemporaryGettingStarted.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ can be used with):
6565

6666
```swift
6767
platforms: [
68-
.macOS(.v13), .iOS(.v16), .watchOS(.v9), .tvOS(.v16), .visionOS(.v1)
68+
.macOS(.v10_15), .iOS(.v13), .watchOS(.v6), .tvOS(.v13), .macCatalyst(.v13), .visionOS(.v1)
6969
],
7070
```
7171

0 commit comments

Comments
 (0)