@@ -71,40 +71,38 @@ object Parser {
7171 }
7272
7373 class Parse : CliktCommand () {
74- val env: String by option(help= " Path to env file." ).default(" .env" )
75-
76- override fun run (){
77-
78- val file = File (" delphix.yaml" )
79- try {
80- fileExists(file)
81- } catch (e: NoSuchFileException ) {
82- System .err.println (e.message + " is required." )
83- System .exit(0 )
74+ val env: String by option(help= " Path to env file." ).default(" .env" )
75+
76+ override fun run (){
77+ val file = File (" delphix.yaml" )
78+ try {
79+ fileExists(file)
80+ } catch (e: NoSuchFileException ) {
81+ System .err.println (e.message + " is required." )
82+ System .exit(0 )
83+ }
84+
85+ val contents = loadYamlFromFile(file)
86+ try {
87+ Validator (contents).validate()
88+ } catch (e: IllegalArgumentException ) {
89+ System .err.println (e.message)
90+ System .exit(0 )
91+ }
92+
93+ val env: Map <String , String > = loadEnvs(env)
94+ val delphix: Delphix = Delphix (Http (env[" delphixEngine" ]? : " " ))
95+ val yaml: Yaml = Mapper ().mapYaml(contents)
96+ val runner: Runner = Runner (yaml, env, delphix)
97+
98+ try {
99+ runner.run ()
100+ }
101+ catch (e: Exception ) {
102+ System .err.println (e.message)
103+ System .exit(0 )
104+ }
84105 }
85-
86- val contents = loadYamlFromFile(file)
87- try {
88- Validator (contents).validate()
89- } catch (e: IllegalArgumentException ) {
90- System .err.println (e.message)
91- System .exit(0 )
92- }
93-
94- val env: Map <String , String > = loadEnvs(env)
95- val delphix: Delphix = Delphix (Http (env[" delphixEngine" ]? : " " ))
96- val yaml: Yaml = Mapper ().mapYaml(contents)
97- val runner: Runner = Runner (yaml, env, delphix)
98-
99- try {
100- runner.run ()
101- }
102- catch (e: Exception ) {
103- System .err.println (e.message)
104- System .exit(0 )
105- }
106-
107- }
108106 }
109107
110108 @JvmStatic
0 commit comments