makeSearchPath
lib.strings.makeSearchPath
Docs pulled from | This Revision | 14 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.
makeSearchPath =
subDir: paths:
concatStringsSep ":" (
concatMap (path: if path != null then [ (path + "/" + subDir) ] else [ ]) paths
);