Skip to content

Commit

Permalink
Merge pull request #2 from leavez/bugfix
Browse files Browse the repository at this point in the history
Fix crash when PATH missing
  • Loading branch information
leavez authored Apr 19, 2021
2 parents 778f3cd + 5119bdc commit eb483c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/Shell/Runner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func runInner(_ executablePath: String, args: [String], stdin: Any?, stdout: Any
}

func lookupInPATH(file: String) -> String? {
let PATH = String(utf8String: getenv("PATH")) ?? ""
let PATH = ProcessInfo.processInfo.environment["PATH"] ?? ""

for dir in PATH.split(separator: ":") {
let path = URL(fileURLWithPath: String(dir))
Expand Down

0 comments on commit eb483c7

Please sign in to comment.