Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Shelm currently uses the depth argument in a
find
call. This argument exists in the macOS implementation offind
, but does not in Linux implementations. This PR replaces this argument with a filter of all paths removing any that do not include 3 slashes, equivalent to the "--depth 3" argument that currently exists. Becausegrep
will fail if this filter does not return a result, I've added a fallback in|| :
to ensure the function returns nothing if no directories are found, just like the existing script.Basically, this change allows shelm to work on both macOS and Linux.
I've tested this implementation on macOS and an Alpine image, and fetch and make both work the same as how the code exists currently.