Skip to content

Commit 3818644

Browse files
committed
Unconditionally create the target directory.
For running in builds, don't require clients to create the specified directory in advance.
1 parent 9eb5b0d commit 3818644

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎hamcrest-generator/src/main/java/org/hamcrest/generator/config/XmlConfigurator.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ public static void main(String[] args) throws Exception {
8787
String packageName = dotIndex == -1 ? "" : fullClassName.substring(0, dotIndex);
8888
String shortClassName = fullClassName.substring(dotIndex + 1);
8989

90-
if (!outputDir.isDirectory()) {
91-
System.err.println("Output directory not found : " + outputDir.getAbsolutePath());
90+
if (!outputDir.isDirectory() && !outputDir.mkdirs()) {
91+
System.err.println("Unable to create directory not : " + outputDir.getAbsolutePath());
9292
System.exit(-1);
9393
}
9494

0 commit comments

Comments
 (0)