From c39c13c21cd089956019f29be767e27e4ecaa502 Mon Sep 17 00:00:00 2001 From: Ronny Edler <19165931+edler-san@users.noreply.github.com> Date: Thu, 18 Apr 2019 10:47:30 +0200 Subject: [PATCH] Added support for ignore-non-theme-folders configuration option --- src/main/java/com/vaadin/sass/SassCompiler.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/vaadin/sass/SassCompiler.java b/src/main/java/com/vaadin/sass/SassCompiler.java index b3cba30a..86e19138 100644 --- a/src/main/java/com/vaadin/sass/SassCompiler.java +++ b/src/main/java/com/vaadin/sass/SassCompiler.java @@ -62,6 +62,11 @@ public static void main(String[] args) throws Exception { .defaultValue("false") .help("Let compilation succeed even though there are warnings"); + argp.defineOption("ignore-non-theme-folders").values("true", "false") + .defaultValue("false") + .help("Skips compilation attempt for folders that do not cantain an .scss file." + + " This stops the compilation to fail on folders created by versioning systems."); + argp.parse(args); String input = argp.getInputFile(); @@ -74,9 +79,15 @@ public static void main(String[] args) throws Exception { .parseBoolean(argp.getOptionValue("compress")); boolean ignoreWarnings = Boolean.parseBoolean(argp .getOptionValue("ignore-warnings")); + boolean ignoreNonThemeFolders = Boolean.parseBoolean(argp + .getOptionValue("ignore-non-theme-folders")); File in = new File(input); if (!in.canRead()) { + if(ignoreNonThemeFolders) { + System.err.println(in.getParent() + " does not contain a theme file. Ignoring."); + return; //throw no exception here + } System.err.println(in.getCanonicalPath() + " could not be read!"); System.exit(ERROR_FILE_NOT_FOUND); }