Skip to content

Commit

Permalink
fix(linux): do not assume the location of which (#803)
Browse files Browse the repository at this point in the history
It is now invoked, like other commands, using `/usr/bin/env`.

Signed-off-by: Julia DeMille <me@jdemille.com>
  • Loading branch information
judemille authored Feb 4, 2024
1 parent 93d94e5 commit 5e4a715
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/SourceKittenFramework/library_wrapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ internal let linuxSourceKitLibPath = env("LINUX_SOURCEKIT_LIB_PATH")

/// If available, uses `swiftenv` to determine the user's active Swift root.
internal let linuxFindSwiftenvActiveLibPath: String? = {
guard let swiftenvPath = Exec.run("/usr/bin/which", "swiftenv").string else {
guard let swiftenvPath = Exec.run("/usr/bin/env", "which", "swiftenv", stderr: .discard).string else {
return nil
}

Expand All @@ -98,7 +98,7 @@ internal let linuxFindSwiftenvActiveLibPath: String? = {
/// Attempts to discover the location of libsourcekitdInProc.so by looking at
/// the `swift` binary on the path.
internal let linuxFindSwiftInstallationLibPath: String? = {
guard let swiftPath = Exec.run("/usr/bin/which", "swift").string else {
guard let swiftPath = Exec.run("/usr/bin/env", "which", "swift", stderr: .discard).string else {
return nil
}

Expand Down

0 comments on commit 5e4a715

Please sign in to comment.