We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2853d7d commit 9cbd13dCopy full SHA for 9cbd13d
Sources/markdown-tool/Commands/FormatCommand.swift
@@ -126,11 +126,16 @@ extension MarkdownCommand {
126
/// Search for the an executable with a given base name.
127
func findExecutable(named name: String) throws -> String? {
128
let which = Process()
129
- which.launchPath = "/usr/bin/which"
130
which.arguments = [name]
131
let standardOutput = Pipe()
132
which.standardOutput = standardOutput
133
- which.launch()
+ if #available(macOS 10.13, *) {
+ which.executableURL = URL(fileURLWithPath: "/usr/bin/which")
134
+ try which.run()
135
+ } else {
136
+ which.launchPath = "/usr/bin/which"
137
+ which.launch()
138
+ }
139
which.waitUntilExit()
140
141
guard which.terminationStatus == 0,
0 commit comments