File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 13
13
say "Remove app/assets/stylesheets/application.css so build output can take over"
14
14
remove_file "app/assets/stylesheets/application.css"
15
15
16
+ if ( app_layout_path = Rails . root . join ( "app/views/layouts/application.html.erb" ) ) . exist?
17
+ say "Add stylesheet link tag in application layout"
18
+ insert_into_file (
19
+ app_layout_path . to_s ,
20
+ defined? ( Turbo ) ?
21
+ %(\n <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>) :
22
+ %(\n <%= stylesheet_link_tag "application" %>) ,
23
+ before : /\s *<\/ head>/
24
+ )
25
+ else
26
+ say "Default application.html.erb is missing!" , :red
27
+ if defined? ( Turbo )
28
+ say %( Add <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %> within the <head> tag in your custom layout.)
29
+ else
30
+ say %( Add <%= stylesheet_link_tag "application" %> within the <head> tag in your custom layout.)
31
+ end
32
+ end
33
+
16
34
unless Rails . root . join ( "package.json" ) . exist?
17
35
say "Add default package.json"
18
36
copy_file "#{ __dir__ } /package.json" , "package.json"
You can’t perform that action at this time.
0 commit comments