Last active
November 9, 2021 19:03
-
-
Save doshyt/81fe7b9004de53726e067e8d79f88468 to your computer and use it in GitHub Desktop.
One-liner to find all versions of a given package in node_modules of multiple repos. Add the list of folders to scan as TARGETS and the name of a culprit package - i.e. "rc".
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
CULPRIT="rc"; TARGETS=( "awesome-repo-1" "awesome-repo-2" ); for element in "${TARGETS[@]}"; do echo "Checking $element"; find $element/node_modules -path "*/$CULPRIT/**" -prune -name "package.json" -exec cat {} + | grep -e \"version\": -e _location ; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment