Last active
January 19, 2021 03:51
-
-
Save justanotherdot/b36d64d85ad2a58016d34b053787b882 to your computer and use it in GitHub Desktop.
Find all javascript source files imported zero or one times.
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
suffix="js" | |
for f in $(rg -lt $suffix . src | xargs basename | sed -e "s/\.$suffix//"); do | |
count=$(rg $f -l | wc -l | xargs ); | |
if [ $(( $count )) -eq 1 ] || [ $(( $count )) -eq 0 ]; then | |
echo "count: $count file: $f"; | |
fi; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment