Skip to content
This repository was archived by the owner on May 5, 2022. It is now read-only.

Added support for ignore-non-theme-folders configuration option #321

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/main/java/com/vaadin/sass/SassCompiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
}
Expand Down