Fix bug where template.yaml gets replaced whenever user wants to look at help dialog

This commit is contained in:
Joel Therrien 2019-02-28 11:12:21 -08:00
parent a7f591c2d3
commit 29b154110a

View file

@ -47,8 +47,16 @@ public class Main {
System.out.println("Must provide two arguments - the path to the settings.yaml file and instructions to either train or analyze."); System.out.println("Must provide two arguments - the path to the settings.yaml file and instructions to either train or analyze.");
System.out.println("Note that analyzing only supports competing risk data, and that you must then specify a sample size for testing errors."); System.out.println("Note that analyzing only supports competing risk data, and that you must then specify a sample size for testing errors.");
if(args.length == 0){ if(args.length == 0){
System.out.println("Generating template file."); final File templateFile = new File("template.yaml");
defaultTemplate().save(new File("template.yaml")); if(templateFile.exists()){
System.out.println("Template file exists; not creating a new one");
}
else{
System.out.println("Generating template file.");
defaultTemplate().save(templateFile);
}
} }
return; return;
} }