Skip to content

Instantly share code, notes, and snippets.

@ethul
Created May 9, 2012 19:08
Show Gist options
  • Save ethul/2648083 to your computer and use it in GitHub Desktop.
Save ethul/2648083 to your computer and use it in GitHub Desktop.
# keep only necessary jars in the slug
START_SCRIPT="target/start"
if [ -f $START_SCRIPT ] && [ -d $SBT_USER_HOME/.ivy2 ] ; then
echo "-----> Dropping unnecessary ivy cached jars from the slug"
for jar in $(find $SBT_USER_HOME/.ivy2 -name '*.jar' | xargs -0) ; do
[[ -f "$jar" ]] || continue
jar_name=`basename "$jar"`
if grep $jar_name $START_SCRIPT >/dev/null; then
echo "Keeping: $jar_name"
else
echo "Dropping: $jar_name"
rm -f $jar
fi
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment