Skip to content
Merged
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
6 changes: 5 additions & 1 deletion core/lib/generators/refinery/engine/engine_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@ def reject_file?(file)
(skip_frontend? && in_frontend_directory?(file)) || super
end

# Match against the path inside the templates directory only, so an "app"
# elsewhere in the absolute path (e.g. ~/apps or /app in a container)
# doesn't mark every template as frontend.
def in_frontend_directory?(file)
file.to_s.include?('app') && file.to_s.scan(/admin|models|mailers/).empty?
path = Pathname.new(file).relative_path_from(source_pathname).to_s
path.start_with?('app/') && !path.match?(/admin|models|mailers/)
end

end
Expand Down
Loading