Skip to content

Commit 2883705

Browse files
author
David Heinemeier Hansson
committed
Skip sprockets manifest addition if manifest is not found
1 parent 54b57b6 commit 2883705

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/install/install.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
say "Compile into app/assets/builds"
22
empty_directory "app/assets/builds"
33
keep_file "app/assets/builds"
4-
append_to_file "app/assets/config/manifest.js", %(//= link_tree ../builds\n)
4+
5+
if (sprockets_manifest_path = Rails.root.join("app/assets/config/manifest.js")).exist?
6+
append_to_file sprockets_manifest_path, %(//= link_tree ../builds\n)
7+
end
58

69
if Rails.root.join(".gitignore").exist?
710
append_to_file(".gitignore", %(\n/app/assets/builds/*\n!/app/assets/builds/.keep\n/node_modules\n))

0 commit comments

Comments
 (0)