Last active
November 27, 2018 10:35
-
-
Save Auronmatrix/7bb3c4ae1a0a01360aef4c5e7aec63f7 to your computer and use it in GitHub Desktop.
BashScript to check all subfolders for compromised dependency (https://github.com/dominictarr/event-stream/issues/116)
This file contains hidden or 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 | |
function recursiveCheck() { | |
for d in * ; do | |
if [ $d == "node_modules" ] ; then | |
#echo "Skipping $PWD" | |
else if [ -d "$d" ]; then | |
cd "$d" | |
#echo "Checking $PWD" | |
if [ -f "package.json" ]; | |
then | |
npm ls event-stream flatmap-stream | |
else | |
recursiveCheck | |
fi | |
cd .. | |
fi | |
fi | |
done | |
} | |
recursiveCheck |
Thanks. I'll add that and changes recommended by @luchsamapparat (dominictarr/event-stream#116 (comment)) to a new revision
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It didn't work for me on Mac, so I edited this a bit:
Run from home dir, found one project that used the package as a dev-dependency. Thanks a lot!