Created
June 29, 2016 14:09
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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