Skip to content

Commit

Permalink
work on recursive latex files
Browse files Browse the repository at this point in the history
  • Loading branch information
jmmaloney4 committed Jul 4, 2023
1 parent 43a8be2 commit ba05e13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/findLatexFiles.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ let
processDirectory = rootPath: extensions: let
readDir = builtins.readDir rootPath;

# paths = traceVal (mapAttrs (name: type: rootPath + "/${name}") readDir);
# paths = traceVal (mapAttrs ( name: type: rootPath + "/${name}") readDir);
directories = attrNames (filterAttrs (name: type: type == "directory") readDir);
files = attrNames (filterAttrs (name: type: type == "regular") readDir);
filesWithExtensions = filter (name: lists.any (ext: strings.hasSuffix ext name) extensions) files;
fullPaths = map (name: rootPath + "/${name}") filesWithExtensions;
recuriveFiles = builtins.concatLists (map (name: processDirectory (rootPath + "/${name}") extensions) directories);
in
filesWithExtensions ++ recuriveFiles;
Expand Down

0 comments on commit ba05e13

Please sign in to comment.