Skip to content

Instantly share code, notes, and snippets.

@jrmullen
Created October 25, 2021 16:13
Show Gist options
  • Save jrmullen/1014aacaa3f073e7dc72df153e02ad6f to your computer and use it in GitHub Desktop.
Save jrmullen/1014aacaa3f073e7dc72df153e02ad6f to your computer and use it in GitHub Desktop.
Search all projects for bad dependency
#!/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