jbang
jbang copied to clipboard
fix: testing that user doesn't pass folder to --cp
Fixes #2045
Summary by Sourcery
Disallow users from passing directories to the --cp option by validating classpath entries and throwing an error when a directory is detected, and ensure this validation runs across all CLI commands.
Bug Fixes:
- Reject directories passed to --cp and report an illegal argument error
Enhancements:
- Introduce a shared validate() method for DependencyInfoMixin and invoke it in all relevant commands
Tests:
- Add a test to verify that passing a folder to --cp raises an IllegalArgumentException