|
38 | 38 | copy_file "#{__dir__}/application.tailwind.css", "app/assets/stylesheets/application.tailwind.css"
|
39 | 39 | end
|
40 | 40 |
|
41 |
| -if Rails.root.join("Procfile.dev").exist? |
42 |
| - append_to_file "Procfile.dev", "css: bin/rails tailwindcss:watch\n" |
| 41 | +if Rails.root.join("config/puma.rb").exist? |
| 42 | + say "Add tailwindcss as Puma plugin" |
| 43 | + append_to_file "config/puma.rb", "\nplugin :tailwindcss if ENV.fetch(\"RAILS_ENV\", \"development\") == \"development\"\n" |
43 | 44 | else
|
44 |
| - say "Add default Procfile.dev" |
45 |
| - copy_file "#{__dir__}/Procfile.dev", "Procfile.dev" |
| 45 | + if Rails.root.join("Procfile.dev").exist? |
| 46 | + append_to_file "Procfile.dev", "css: bin/rails tailwindcss:watch\n" |
| 47 | + else |
| 48 | + say "Add default Procfile.dev" |
| 49 | + copy_file "#{__dir__}/Procfile.dev", "Procfile.dev" |
| 50 | + |
| 51 | + say "Ensure foreman is installed" |
| 52 | + run "gem install foreman" |
| 53 | + end |
46 | 54 |
|
47 |
| - say "Ensure foreman is installed" |
48 |
| - run "gem install foreman" |
| 55 | + say "Add bin/dev to start foreman" |
| 56 | + copy_file "#{__dir__}/dev", "bin/dev" |
| 57 | + chmod "bin/dev", 0755, verbose: false |
49 | 58 | end
|
50 | 59 |
|
51 |
| -say "Add bin/dev to start foreman" |
52 |
| -copy_file "#{__dir__}/dev", "bin/dev" |
53 |
| -chmod "bin/dev", 0755, verbose: false |
54 |
| - |
55 | 60 | say "Compile initial Tailwind build"
|
56 | 61 | run "rails tailwindcss:build"
|
0 commit comments