Skip to content

Commit 52515eb

Browse files
authored
Merge pull request #469 from patriciomacadden/remove-inter-font-before-upgrading
remove inter font before upgrading using the npx script
2 parents 5c63a24 + b5aac18 commit 52515eb

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

lib/install/upgrade_tailwindcss.rb

+12-12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@
1717
FileUtils.mv(POSTCSS_CONFIG_PATH, Rails.root, verbose: true) || abort
1818
end
1919

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+
2032
if system("npx --version")
2133
say "Running the upstream Tailwind CSS upgrader"
2234
command = Shellwords.join(["npx", "@tailwindcss/upgrade@next", "--force", "--config", TAILWIND_CONFIG_PATH.to_s])
@@ -32,17 +44,5 @@
3244
abort
3345
end
3446

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-
4747
say "Compile initial Tailwind build"
4848
run "rails tailwindcss:build"

0 commit comments

Comments
 (0)