Skip to content

Commit 465afa7

Browse files
AZero13Kyle-Ye
andcommitted
Modernize code to not rely on deprecations and old behavior
Co-Authored-By: Kyle <[email protected]>
1 parent 8255a77 commit 465afa7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/Foundation/Process.swift

+5-1
Original file line numberDiff line numberDiff line change
@@ -1149,7 +1149,11 @@ open class Process: NSObject, @unchecked Sendable {
11491149
// convenience; create and launch
11501150
open class func launchedProcess(launchPath path: String, arguments: [String]) -> Process {
11511151
let process = Process()
1152-
process.launchPath = path
1152+
if #available(macOS 10.13, *) {
1153+
process.executableURL = URL(fileURLWithPath:path)
1154+
} else {
1155+
process.launchPath = path
1156+
}
11531157
process.arguments = arguments
11541158
process.launch()
11551159

0 commit comments

Comments
 (0)