Skip to content

Instantly share code, notes, and snippets.

@igormukhin
Created June 29, 2016 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igormukhin/f606c4e58ce77e515d866e4d6de0c4da to your computer and use it in GitHub Desktop.
Save igormukhin/f606c4e58ce77e515d866e4d6de0c4da to your computer and use it in GitHub Desktop.
Searches in a directory recursively for CSS files that has no corresponding LESS files
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class FindCssFilesWithoutLess {
public static void main(String[] args) throws IOException {
Path filesSrcDir = Paths.get(".\\data");
Files.walk(filesSrcDir)
.filter(p -> p.toString().toLowerCase().endsWith(".css"))
.forEach(p -> {
Path less = p.resolveSibling(p.getFileName().toString().toLowerCase().replace(".css", ".less"));
if (!Files.exists(less)) {
System.out.println(less);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment