makeSearchPath
lib.makeSearchPath
Docs pulled from | This Revision | 22 minutes ago
Nixpkgs manual
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"
Noogle detected
Implementation
The following is the current implementation of this function.
subDir:
let
concatPaths = concatMap (path: if path != null then [ (path + "/" + subDir) ] else [ ]);
in
paths: concatColons (concatPaths paths)