Skip to content

Commit

Permalink
fix missing output dir bug
Browse files Browse the repository at this point in the history
  • Loading branch information
moraru committed Feb 19, 2022
1 parent 9ad4803 commit 11ef9ae
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions vcell-cli/src/main/java/org/vcell/cli/CLIStandalone.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,18 @@ public static void main(String[] args) {
}

Executable.setTimeoutMS(CLIUtils.EXECUTABLE_MAX_WALLCLOK_MILLIS);

// create base output dir if not exists
String outputDir = args[3];
try {
Files.createDirectories(Paths.get(outputDir));
} catch (IOException e2) {
// TODO Auto-generated catch block
System.err.println("Specified output directory "+outputDir+" does not exist and could not be created");
System.exit(1);
}

if (input != null && input.isDirectory()) {
String outputDir = args[3];

FilenameFilter filter = (f, name) -> name.endsWith(".omex") || name.endsWith(".vcml");
String[] inputFiles = input.list(filter);
if (inputFiles == null) System.out.println("No input files found in the directory");
Expand Down Expand Up @@ -133,15 +141,9 @@ public static void main(String[] args) {
try {
if (inputFile.endsWith("omex")) {
String bioModelBaseName = org.vcell.util.FileUtils.getBaseName(inputFile);
args[3] = outputDir + File.separator + bioModelBaseName;
// Files.createDirectories(Paths.get(args[3]));
boolean mkdirs = new File(args[3]).mkdirs();
if (mkdirs) {
System.out.println("Created path "+args[3]);
} else {
throw new FileSystemException(args[3]);
}
System.out.println(LocalTime.now());
// make subdirs
outputDir = outputDir + File.separator + bioModelBaseName;
Files.createDirectories(Paths.get(outputDir));
singleExecOmex(utils, outputDir, keepTempFiles, exactMatchOnly, args);
}
if (inputFile.endsWith("vcml")) {
Expand Down

0 comments on commit 11ef9ae

Please sign in to comment.