Shopify/packwerk

[Bug Report] `bundle exec` and `bin/packwerk` produces different behaviour

wildmaples opened this issue · 0 comments

Description
bundle exec packwerk and bin/packwerk produces different result. bin/packwerk loads files while bundle exec does not.

To Reproduce
Try bundle exec packwerk validate and bin/packwerk validate
packwerk validate requires files to be loaded, so it will fail on the bundle exec command.

Expected Behaviour
packwerk validate requires files to be loaded, so it will fail on the bundle exec command.

Screenshots
If applicable, add screenshots to help explain your problem.

Version Information

  • Packwerk: v1.1.0

Additional Context
The solution is to move the file loading logic from bin/packwerk script into ApplicationLoadPath. ApplicationLoadPath is only used in packwerk init and packwerk validate commands, the two commands that require Rails to be booted.

For additional context, see: #77 (comment)