Created
August 23, 2016 13:51
-
-
Save tobias/619145a7ae5b68eac9a3e2a4e9e7003d to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
if [ "$1" == "-q" ]; then | |
shift | |
OUT=/dev/null | |
else | |
OUT=/dev/stdout | |
fi | |
find -L . -name "*.jar" -type f | while read i; do | |
dir=$(dirname "${i}") | |
toc="${dir}/.moduleseek-cache" | |
if [ ! -f ${toc} ]; then | |
jar tf $i > ${toc} | |
fi | |
grep -i "$@" ${toc} > ${OUT} | |
if [ $? -eq 0 ]; then | |
mod=$(grep "module xmlns" "${dir}/module.xml") | |
echo | |
echo "==> module: $mod" | |
echo "==> jar: $i" | |
echo | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment