aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorYoong Kang Lim <yoongkang.lim@gmail.com>2015-05-26 21:52:10 +1000
committerGodfrey Chan <godfreykfc@gmail.com>2015-05-30 00:44:12 -0700
commitf06ce4c12a396795a3b2c1812951d9277bcb3a82 (patch)
treebbebbb70cfe0b71deacd3347aa67517102e88aab /railties/lib
parent6fc83f8efeb1637af5d17b0d7b0c4b2e3db3c001 (diff)
downloadrails-f06ce4c12a396795a3b2c1812951d9277bcb3a82.tar.gz
rails-f06ce4c12a396795a3b2c1812951d9277bcb3a82.tar.bz2
rails-f06ce4c12a396795a3b2c1812951d9277bcb3a82.zip
Generate a `.keep` file in `tmp` folder
A lot of scripts assumes the existence of this folder and most would fail if it is absent. One example of this is `rake restart` (before the previous commit) – it tries to `touch tmp/restart.txt`, which would fail if `tmp` does not exist, which was the case for a freshly-cloned project as `tmp` is `.gitignored` by default. See #20299. [Yoong Kang Lim, Sunny Juneja]
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/rails/app/app_generator.rb1
-rw-r--r--railties/lib/rails/generators/rails/app/templates/gitignore3
2 files changed, 3 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/rails/app/app_generator.rb b/railties/lib/rails/generators/rails/app/app_generator.rb
index 1047a2c429..152c26860e 100644
--- a/railties/lib/rails/generators/rails/app/app_generator.rb
+++ b/railties/lib/rails/generators/rails/app/app_generator.rb
@@ -141,6 +141,7 @@ module Rails
end
def tmp
+ empty_directory_with_keep_file "tmp"
empty_directory "tmp/cache"
empty_directory "tmp/cache/assets"
end
diff --git a/railties/lib/rails/generators/rails/app/templates/gitignore b/railties/lib/rails/generators/rails/app/templates/gitignore
index e4a00ad181..1b8cf8a9fa 100644
--- a/railties/lib/rails/generators/rails/app/templates/gitignore
+++ b/railties/lib/rails/generators/rails/app/templates/gitignore
@@ -15,7 +15,8 @@
<% end -%>
# Ignore all logfiles and tempfiles.
/log/*
+/tmp/*
<% if keeps? -%>
!/log/.keep
+!/tmp/.keep
<% end -%>
-/tmp