Skip to content
Browse files

Use for loop instead of xargs for clearing cache.

Otherwise it fails when no jars are stale.debug.
  • Loading branch information...
1 parent e0e97e9 commit f6c8c333c800702e6b71cc629a231de140863085 @technomancy technomancy committed Apr 18, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 bin/compile
View
9 bin/compile
@@ -56,9 +56,12 @@ if [ "${PIPESTATUS[*]}" != "0 0" ]; then
fi
# Clear unused jars
-join -v 1 <(find "$LOCAL_REPOSITORY" -name '*.jar' | sort) \
- <(.lein/bin/lein classpath | tr : "\n" | sort) | \
- xargs -d"\n" rm
+STALE_JARS=$(join -v 1 <(find "$LOCAL_REPOSITORY" -name '*.jar' | sort) \
+ <(.lein/bin/lein classpath | tr : "\n" | sort))
+
+for jar in $STALE_JARS; do
+ rm -rf $(dirname "$jar")
+done
# Repopulate cache
rm -rf $CACHE_REPOSITORY

0 comments on commit f6c8c33

Please sign in to comment.
Something went wrong with that request. Please try again.