Skip to content

Commit 1ed0ac0

Browse files
authored
Switch count-lines to macOS 12 only (#576)
CI is allowing a `guard #available(macOS 12)` in the tests to pass, but then reporting macOS version 10.16 both in ProcessInfo and in the guard in the actual `CountLines.run()` method, which results in an inconsistency. Switching the minimum platform for `count-lines` until we can sort out the configuration issue.
1 parent c5050aa commit 1ed0ac0

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

Examples/count-lines/CountLines.swift

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import ArgumentParser
1313
import Foundation
1414

1515
@main
16-
@available(macOS 10.15, *)
16+
@available(macOS 12, *)
1717
struct CountLines: AsyncParsableCommand {
1818
@Argument(
1919
help: "A file to count lines in. If omitted, counts the lines of stdin.",
@@ -27,7 +27,7 @@ struct CountLines: AsyncParsableCommand {
2727
var verbose = false
2828
}
2929

30-
@available(macOS 10.15, *)
30+
@available(macOS 12, *)
3131
extension CountLines {
3232
var fileHandle: FileHandle {
3333
get throws {
@@ -58,11 +58,6 @@ extension CountLines {
5858
}
5959

6060
mutating func run() async throws {
61-
guard #available(macOS 12.0, iOS 15.0, tvOS 15.0, watchOS 8.0, *) else {
62-
print("'count-lines' isn't supported on this platform.")
63-
return
64-
}
65-
6661
let countAllLines = prefix == nil
6762
let lineCount = try await fileHandle.bytes.lines.reduce(0) { count, line in
6863
if countAllLines || line.starts(with: prefix!) {

0 commit comments

Comments
 (0)