@@ -67,12 +67,17 @@ def run
67
67
raise "YAML configuration is missing the 'pgsql' section" unless yml [ 'pgsql' ]
68
68
@master = File . expand_path ( @master )
69
69
unless File . exist? ( @master )
70
- raise "Liquibase master is absent at '#{ @master } '. \
71
- More about this file you can find in Liquibase documentation: \
72
- https://docs.liquibase.com/concepts/changelogs/xml-format.html"
70
+ raise \
71
+ "Liquibase master is absent at '#{ @master } '. " \
72
+ 'More about this file you can find in Liquibase documentation: ' \
73
+ 'https://docs.liquibase.com/concepts/changelogs/xml-format.html'
73
74
end
74
75
pom = File . expand_path ( File . join ( __dir__ , '../../resources/pom.xml' ) )
75
76
old = @liquibase_version . match? ( /^[1-3]\. .+$/ )
77
+ url = yml [ 'pgsql' ] [ 'url' ]
78
+ raise "The 'url' is not set in the config (YAML)" if url . nil?
79
+ password = yml [ 'pgsql' ] [ 'password' ]
80
+ raise "The 'password' is not set in the config (YAML)" if password . nil?
76
81
Dir . chdir ( File . dirname ( @master ) ) do
77
82
system (
78
83
[
@@ -92,9 +97,9 @@ def run
92
97
'--define' ,
93
98
"liquibase.changeLogFile=#{ old ? @master : File . basename ( @master ) } " ,
94
99
'--define' ,
95
- "liquibase.url=#{ Shellwords . escape ( yml [ 'pgsql' ] [ ' url' ] ) } " ,
100
+ "liquibase.url=#{ Shellwords . escape ( url ) } " ,
96
101
'--define' ,
97
- "liquibase.password=#{ Shellwords . escape ( yml [ 'pgsql' ] [ ' password' ] ) } " ,
102
+ "liquibase.password=#{ Shellwords . escape ( password ) } " ,
98
103
'--define' ,
99
104
"liquibase.logging=#{ @quiet ? 'severe' : 'info' } " ,
100
105
'2>&1'
0 commit comments