Created
October 25, 2021 16:13
-
-
Save jrmullen/1014aacaa3f073e7dc72df153e02ad6f to your computer and use it in GitHub Desktop.
Search all projects for bad dependency
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Recursively search for any text matching the provided dependency within the provided directory, ignoring any /node_modules directory | |
# Outputs any files that contain text. To get the actual text back, simply remove the `-l` flag. | |
# | |
# e.g. ./search-bad-dependency.sh ua-parser-js src/ | |
# | |
# will return the paths to any files in the src/ directory, excluding any directories called `node_modules`, containing text matching `ua-parser-js` | |
grep -R -l --exclude-dir=node_modules $1 $2 | |
echo "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment