144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
|
# File 'lib/spring/client/run.rb', line 144
def run_command(client, application)
log "sending command"
application.send_io STDOUT
application.send_io STDERR
application.send_io STDIN
send_json application, "args" => args, "env" => ENV.to_hash
pid = server.gets
pid = pid.chomp if pid
client.close
if pid && !pid.empty?
log "got pid: #{pid}"
forward_signals(application)
status = application.read.to_i
log "got exit status #{status}"
exit status
else
log "got no pid"
exit 1
end
ensure
application.close
end
|