File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change 1+ ## Next Release
2+
3+ * Start server process in directory where command was called
4+
15## 2.1.0
26
37* Add explicit support for Rails 6 (no changes were needed)
Original file line number Diff line number Diff line change @@ -172,6 +172,11 @@ def serve(client)
172172 end
173173 end
174174
175+ # Ensure we boot the process in the directory the command was called from,
176+ # not from the directory Spring started in
177+ original_dir = Dir . pwd
178+ Dir . chdir ( env [ 'PWD' ] || original_dir )
179+
175180 pid = fork {
176181 Process . setsid
177182 IGNORE_SIGNALS . each { |sig | trap ( sig , "DEFAULT" ) }
@@ -237,6 +242,7 @@ def serve(client)
237242 # (i.e. to prevent `spring rake -T | grep db` from hanging forever),
238243 # even when exception is raised before forking (i.e. preloading).
239244 reset_streams
245+ Dir . chdir ( original_dir )
240246 end
241247
242248 def terminate
You can’t perform that action at this time.
0 commit comments