public void RunScript(Options opts) { message.WriteMessage("\nAutomation Begin:\n"); message.WriteMessage(opts.RootPath); List <UnexecutedScript> unexecutedScript = (List <UnexecutedScript>)scriptExecutor.GetUnexecutedScripts(opts.RootPath, opts.ConnString); foreach (ScriptExecutionResult result in scriptExecutor.RunBatches(unexecutedScript, opts.ConnString, opts.SubsituteList)) { message.WriteMessage(result.ToString()); if (!result.IsSuccess) { ExitFailureProgram($"Overall Status: failure\n{result.errorMessage}\n", 0); } } ExitSuccessProgram("\nOverall Status: Success", 0); }