Skip to content

Instantly share code, notes, and snippets.

@tobias
Created August 23, 2016 13:51
Show Gist options
  • Save tobias/619145a7ae5b68eac9a3e2a4e9e7003d to your computer and use it in GitHub Desktop.
Save tobias/619145a7ae5b68eac9a3e2a4e9e7003d to your computer and use it in GitHub Desktop.
#!/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