Skip to content

Commit

Permalink
Use clearer variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
stevapple committed Apr 22, 2022
1 parent 947f56f commit 283c833
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/TSCBasic/misc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,9 @@ public func lookupExecutablePath(
return nil
}
#if os(Windows)
let isPath = value.contains(":") || value.contains("\\") || value.contains("/")
let isFileName = !value.contains(":") && !value.contains("\\") && !value.contains("/")
#else
let isPath = value.contains("/")
let isFileName = !value.contains("/")
#endif

var paths: [AbsolutePath] = []
Expand All @@ -241,8 +241,8 @@ public func lookupExecutablePath(
paths.append(absPath)
}

// Ensure the value is not a path.
if !isPath {
// Only search in PATH if the value is a single path component.
if isFileName {
// Try to locate in search paths.
paths.append(contentsOf: searchPaths.map({ $0.appending(component: value) }))
#if os(Windows)
Expand Down

0 comments on commit 283c833

Please sign in to comment.