aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorYoong Kang Lim <yoongkang.lim@gmail.com>2015-05-26 20:47:36 +1000
committerGodfrey Chan <godfreykfc@gmail.com>2015-05-30 00:44:05 -0700
commit6fc83f8efeb1637af5d17b0d7b0c4b2e3db3c001 (patch)
tree0fa0e8406e84c169bad8abad344ac7e1fc0b8a64 /railties/lib
parent109e71d2bb6d2305a091fe7ea96d4f6e9c7cd52d (diff)
downloadrails-6fc83f8efeb1637af5d17b0d7b0c4b2e3db3c001.tar.gz
rails-6fc83f8efeb1637af5d17b0d7b0c4b2e3db3c001.tar.bz2
rails-6fc83f8efeb1637af5d17b0d7b0c4b2e3db3c001.zip
`rake restart` should work without a `tmp` folder
In restart.rake, the creation of tmp/restart.txt would fail if the tmp folder does not exist in the app. This is a problem because apps cloned using git would not have the tmp folder, as the folder is in .gitignore. This commit creates the tmp folder if it does not exist. Fixes #20299 [Yoong Kang Lim, Sunny Juneja]
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/bin/setup2
-rw-r--r--railties/lib/rails/tasks/restart.rake1
2 files changed, 2 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/bin/setup b/railties/lib/rails/generators/rails/app/templates/bin/setup
index 3a5a2cc1e3..0d41f2fe4c 100644
--- a/railties/lib/rails/generators/rails/app/templates/bin/setup
+++ b/railties/lib/rails/generators/rails/app/templates/bin/setup
@@ -25,5 +25,5 @@ chdir APP_ROOT do
system 'ruby bin/rake log:clear tmp:clear'
puts "\n== Restarting application server =="
- touch 'tmp/restart.txt'
+ system 'ruby bin/rake restart'
end
diff --git a/railties/lib/rails/tasks/restart.rake b/railties/lib/rails/tasks/restart.rake
index 1e8940b675..f36c86d81b 100644
--- a/railties/lib/rails/tasks/restart.rake
+++ b/railties/lib/rails/tasks/restart.rake
@@ -1,4 +1,5 @@
desc "Restart app by touching tmp/restart.txt"
task :restart do
+ FileUtils.mkdir_p('tmp')
FileUtils.touch('tmp/restart.txt')
end