query
On this page

makeSearchPath

lib.makeSearchPath

Docs pulled from | This Revision | about 2 hours ago


Construct a Unix-style, colon-separated search path consisting of the given subDir appended to each of the given paths.

Inputs

subDir
Directory name to append
paths
List of base paths

Type

makeSearchPath :: string -> [string] -> string

Examples

lib.strings.makeSearchPath usage example

makeSearchPath "bin" ["/root" "/usr" "/usr/local"]
=> "/root/bin:/usr/bin:/usr/local/bin"
makeSearchPath "bin" [""]
=> "/bin"
(lib.strings.makeSearchPath)

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

makeSearchPath =
    subDir:
    paths:
    concatStringsSep ":" (map (path: path + "/" + subDir) (filter (x: x != null) paths));