convert if/else to lib.optionals
Signed-off-by: ahuston-0 <aliceghuston@gmail.com>
This commit is contained in:
parent
ce9e8d9eaa
commit
9c3330b006
@ -43,10 +43,9 @@
|
|||||||
# lsdir :: Path -> String -> [String]
|
# lsdir :: Path -> String -> [String]
|
||||||
lsdir =
|
lsdir =
|
||||||
dir:
|
dir:
|
||||||
if (builtins.pathExists (dir)) then
|
lib.optionals (builtins.pathExists dir) (
|
||||||
(lib.attrNames (lib.filterAttrs (path: type: type == "directory") (builtins.readDir (dir))))
|
lib.attrNames (lib.filterAttrs (path: type: type == "directory") (builtins.readDir (dir)))
|
||||||
else
|
);
|
||||||
[ ];
|
|
||||||
|
|
||||||
# return full paths of all files in a directory
|
# return full paths of all files in a directory
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user