File tree 2 files changed +10
-0
lines changed
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
+
1
5
## 2.1.0
2
6
3
7
* 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)
172
172
end
173
173
end
174
174
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
+
175
180
pid = fork {
176
181
Process . setsid
177
182
IGNORE_SIGNALS . each { |sig | trap ( sig , "DEFAULT" ) }
@@ -237,6 +242,7 @@ def serve(client)
237
242
# (i.e. to prevent `spring rake -T | grep db` from hanging forever),
238
243
# even when exception is raised before forking (i.e. preloading).
239
244
reset_streams
245
+ Dir . chdir ( original_dir )
240
246
end
241
247
242
248
def terminate
You can’t perform that action at this time.
0 commit comments