@@ -34,10 +34,7 @@ public void run() throws ClassNotFoundException, IOException,
3434 IllegalArgumentException , InvocationTargetException {
3535 Map <ArgumentType , CommandLineArgument > commandLineArguments =
3636 new HashMap <ArgumentType , CommandLineArgument >(this .commandLineArguments ); //clone entries
37- if (isFirstTimeAppHasBeenRun ()){
38- commandLineArguments .put (ArgumentType .BACKUP , new CommandLineArgument (ArgumentType .BACKUP , null ));
39- }
40- ifNecessaryPlantDefaultArgumentToRunKoans (commandLineArguments );
37+ applyAssumedStartupBehaviors (commandLineArguments );
4138 List <CommandLineArgument > sortedArguments = new ArrayList <CommandLineArgument >(commandLineArguments .values ());
4239 Collections .sort (sortedArguments );
4340 for (CommandLineArgument argument : sortedArguments ){
@@ -51,8 +48,15 @@ private boolean isFirstTimeAppHasBeenRun() {
5148 return !dataDirectory .exists ();
5249 }
5350
54- void ifNecessaryPlantDefaultArgumentToRunKoans (Map <ArgumentType , CommandLineArgument > commandLineArguments ) {
55- if (commandLineArguments .isEmpty () ||
51+ void applyAssumedStartupBehaviors (Map <ArgumentType , CommandLineArgument > commandLineArguments ) {
52+ if (isFirstTimeAppHasBeenRun ()){
53+ ArgumentType .BACKUP .run (null );
54+ // really hackish - but this will clear console for first run, not necessary after
55+ for (int i = 0 ; i < 80 ; i ++){
56+ System .out .println ();
57+ }
58+ }
59+ if (commandLineArguments .isEmpty () ||
5660 (!commandLineArguments .containsKey (ArgumentType .RUN_KOANS )
5761 && commandLineArguments .containsKey (ArgumentType .CLASS_ARG ))){
5862 if (KoanConstants .DEBUG ){
@@ -63,7 +67,7 @@ void ifNecessaryPlantDefaultArgumentToRunKoans(Map<ArgumentType, CommandLineArgu
6367 }
6468 }
6569 commandLineArguments .put (ArgumentType .RUN_KOANS , new CommandLineArgument (
66- ArgumentType .RUN_KOANS , null ));
70+ ArgumentType .RUN_KOANS , null , true ));
6771 }
6872 }
6973
0 commit comments