|  | 
| 17 | 17 |   FileUtils.mv(POSTCSS_CONFIG_PATH, Rails.root, verbose: true) || abort | 
| 18 | 18 | end | 
| 19 | 19 | 
 | 
|  | 20 | +if APPLICATION_LAYOUT_PATH.exist? | 
|  | 21 | +  if File.read(APPLICATION_LAYOUT_PATH).match?(/"inter-font"/) | 
|  | 22 | +    say "Strip Inter font CSS from application layout" | 
|  | 23 | +    gsub_file APPLICATION_LAYOUT_PATH.to_s, %r{, "inter-font"}, "" | 
|  | 24 | +  else | 
|  | 25 | +    say "Inter font CSS not detected.", :green | 
|  | 26 | +  end | 
|  | 27 | +else | 
|  | 28 | +  say "Default application.html.erb is missing!", :red | 
|  | 29 | +  say %(        Please check your layouts and remove any "inter-font" stylesheet links.) | 
|  | 30 | +end | 
|  | 31 | + | 
| 20 | 32 | if system("npx --version") | 
| 21 | 33 |   say "Running the upstream Tailwind CSS upgrader" | 
| 22 | 34 |   command = Shellwords.join(["npx", "@tailwindcss/upgrade@next", "--force", "--config", TAILWIND_CONFIG_PATH.to_s]) | 
|  | 
| 32 | 44 |   abort | 
| 33 | 45 | end | 
| 34 | 46 | 
 | 
| 35 |  | -if APPLICATION_LAYOUT_PATH.exist? | 
| 36 |  | -  if File.read(APPLICATION_LAYOUT_PATH).match?(/"inter-font"/) | 
| 37 |  | -    say "Strip Inter font CSS from application layout" | 
| 38 |  | -    gsub_file APPLICATION_LAYOUT_PATH.to_s, %r{, "inter-font"}, "" | 
| 39 |  | -  else | 
| 40 |  | -    say "Inter font CSS not detected.", :green | 
| 41 |  | -  end | 
| 42 |  | -else | 
| 43 |  | -  say "Default application.html.erb is missing!", :red | 
| 44 |  | -  say %(        Please check your layouts and remove any "inter-font" stylesheet links.) | 
| 45 |  | -end | 
| 46 |  | - | 
| 47 | 47 | say "Compile initial Tailwind build" | 
| 48 | 48 | run "rails tailwindcss:build" | 
0 commit comments