Created
July 12, 2018 17:31
-
-
Save shayanb/1f60db4e45b57df2dba4a75150de8403 to your computer and use it in GitHub Desktop.
Bash script to check for affected ESLint compromised ([email protected])
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 | |
# Checks all directories in cwd for compromised eslint version | |
cwd=$PWD | |
for d in `find . -maxdepth 1 -type d`; do | |
cd $d | |
version=$(npm ls 2> /dev/null | grep eslint@ | sed -e 's/.*eslint@\([0-9.]*\).*/\1/') | |
if [ -n "$version" ]; then | |
for v in $version; do | |
echo "$d -> eslint@$v" | |
if [ "$v" = '3.7.2' ]; then | |
echo "COMPROMISED!!! $d" | |
fi | |
done | |
fi | |
cd $cwd | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment