Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Continuous additions of tailwind config to gitinore #1383

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading