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

Add "sources" CLI arg to filter which sources are run during a command #287

Merged
merged 5 commits into from
Jun 19, 2020

Conversation

jonabc
Copy link
Contributor

@jonabc jonabc commented Jun 19, 2020

closes #286

This PR adds an array -s/--sources option to the cache, status, list and notices commands to restrict which sources those commands operate over.

The purpose of this is to accommodate repos that use dependencies from multiple sources but might only update one source at a time. For example you could run bundle install && licensed cache --source bundler, or set up a bundler post hook to run caching anytime packages are installed.

This also fixes a subtle bug that was introduced when enabling shared cache paths. In prior versions, it was safe to put extra data under an applications cache_path, as long as it wasn't in an evaluated sources cache subdirectory. With that change any files under cache_path that did not match to evaluated dependencies would be deleted. With this PR, that behavior is reverted 👍

@jonabc
Copy link
Contributor Author

jonabc commented Jun 19, 2020

Tested against a local repo that I wanted to use this with, looks good 👍 !

@jonabc jonabc merged commit 6a3ae84 into master Jun 19, 2020
@jonabc jonabc deleted the source-filter-cli-arg branch June 19, 2020 17:46
jonabc added a commit that referenced this pull request Jun 19, 2020
## 2.12.0
2020-06-19

### Added
- `--sources` argument for cache, list, status and notices commands to filter running sources (#287)

### Fixed
- `cache` command will not remove files outside of enabled source cache paths (#287)
@jonabc jonabc mentioned this pull request Jun 19, 2020
sergey-alekseev added a commit to sergey-alekseev/bundler-licensed that referenced this pull request Oct 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add CLI arg to override which sources to use in a particular scenario
1 participant