Skip to content

Conversation

@pokonski
Copy link
Contributor

@pokonski pokonski commented May 9, 2024

lib/install/bun/.gitattributes was missing from the final build of the gem. This was causing an error during installation when jsbundling-rails tried to copy its own .gitattributes into host project's root.

Dir["lib/**/*"] does not include files starting with a dot, so I replaced it with a method that does include them. Also stripped directories from the list because according to the specification, they are ignored anyway:

Only add files you can require to this list, not directories, etc.
Directories are automatically stripped from this list when building a gem, other non-files cause an error.

Fixes #175

Proof:

Dir.glob("lib/**/*", File::FNM_DOTMATCH).any? { |path| path.include?(".gitattributes") } => true

vs

Dir["lib/**/*"].any? { |path| path.include?(".gitattributes") } => false
@dhh dhh merged commit 69bfc1c into rails:main Jul 29, 2024
@pokonski pokonski deleted the fix-bundling-gitattributes branch August 1, 2024 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants