File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -155,11 +155,11 @@ class Local < Base
155155 def initialize ( cap_instance )
156156 super ( cap_instance )
157157 @cap . info "Loading local database config"
158- dirty_config_content = @cap . run_locally do
159- capture ( :rails , "runner \" puts ' #{ DBCONFIG_BEGIN_FLAG } ' + ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml + ' #{ DBCONFIG_END_FLAG } ' \" " )
160- end
161- # Remove all warnings, errors and artefacts produced by bunlder, rails and other useful tools
162- config_content = dirty_config_content . match ( /#{ DBCONFIG_BEGIN_FLAG } (.*?)#{ DBCONFIG_END_FLAG } /m ) [ 1 ]
158+ command = " #{ Dir . pwd } /bin/rails runner \" puts ' #{ DBCONFIG_BEGIN_FLAG } ' + ActiveRecord::Base.connection.instance_variable_get(:@config).to_yaml + ' #{ DBCONFIG_END_FLAG } ' \" "
159+ stdout , status = Open3 . capture2 ( command )
160+ raise "Error running command (status= #{ status } ): #{ command } " if status != 0
161+
162+ config_content = stdout . match ( /#{ DBCONFIG_BEGIN_FLAG } (.*?)#{ DBCONFIG_END_FLAG } /m ) [ 1 ]
163163 @config = YAML . load ( config_content ) . inject ( { } ) { |h , ( k , v ) | h [ k . to_s ] = v ; h }
164164 end
165165
You can’t perform that action at this time.
0 commit comments