Skip to content

Commit

Permalink
Issue #12.
Browse files Browse the repository at this point in the history
  • Loading branch information
highsource committed Dec 24, 2014
1 parent a06d06b commit 0080b29
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion full/src/main/java/org/hisrc/jsonix/JsonixMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,19 @@ public static void main(String[] args) throws Exception {
// TODO
System.setProperty("javax.xml.accessExternalDTD", "all");

File targetDirectory = settings.getTargetDirectory();

if (targetDirectory == null) {
targetDirectory = new File(".");
}

if (!targetDirectory.exists()) {
targetDirectory.mkdirs();
}

arguments.add("-d");
arguments.add(targetDirectory.getAbsolutePath());

final Options options = new Options();

options.parseArguments(arguments.toArray(new String[arguments.size()]));
Expand Down Expand Up @@ -87,7 +100,6 @@ private void execute() {

final File targetDirectory = getOptions().targetDir;

targetDirectory.mkdirs();

final ProgramWriter<NType, NClass> programWriter = new TargetDirectoryProgramWriter(
targetDirectory, errorHandler);
Expand Down

0 comments on commit 0080b29

Please sign in to comment.