Skip to content

Commit

Permalink
fix: Continuous additions of tailwind config to gitinore
Browse files Browse the repository at this point in the history
  • Loading branch information
mattpolito committed Oct 1, 2024
1 parent e010015 commit c3ba25a
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions lib/generators/spina/tailwind_config_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,21 @@ module Spina
class TailwindConfigGenerator < Rails::Generators::Base
source_root File.expand_path("../templates", __FILE__)

CONFIG_FILE = "app/assets/config/spina/tailwind.config.js"
IGNORE_TEXT = <<~TEXT.chomp
# Ignore auto-generated Spina Tailwind CSS configuration
/#{CONFIG_FILE}
TEXT

def create_tailwind_config_file
filename = "app/assets/config/spina/tailwind.config.js"
template filename
insert_into_file ".gitignore", <<~TEXT
template CONFIG_FILE

# Ignore auto-generated Spina Tailwind CSS configuration
/#{filename}
TEXT
unless File.read(".gitignore").include?(IGNORE_TEXT)
append_to_file ".gitignore", <<~TEXT
\n
#{IGNORE_TEXT}
TEXT
end
end
end
end

0 comments on commit c3ba25a

Please sign in to comment.