Support for importing index files
Do not clean the output directory if it contains the import directory
@@ -249,8 +249,13 @@ public class IndexCommand implements Command {
private static void setupDirectories(IndexOptions indexOpts) throws IOException {
if (indexOpts.getOutDir().exists()) {
+ if (indexOpts.isImportIndex() &&
+ FileUtils.directoryContains(indexOpts.getOutDir(), indexOpts.getIndexImportDir())) {
+ //Do not clean directory in this case
+ } else {
FileUtils.cleanDirectory(indexOpts.getOutDir());
}
+ }
cleanWorkDir(indexOpts.getWorkDir());
}
