Created
September 26, 2010 19:30
-
-
Save klang/598251 to your computer and use it in GitHub Desktop.
changes physical files in lib and lib/dev to be hardlinks back to the maven repository living in ~/.m2 .. to reduce disk space used in a setting where _a lot_ of Clojure projects using Leiningen is tried in a limited disk space setting.
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 | |
updatedb -l 0 -o ~/.m2db -U ~/.m2 | |
function hardlink { | |
for i in $( ls -1 *.jar ); do | |
link=$(locate -n 1 -d ~/.m2db --regexp "/$i\$") | |
if [ "$link" == "" ]; then | |
echo not linking $i | |
else | |
echo linking $i to $(basename $link) | |
rm $i | |
ln $link $i | |
fi | |
done | |
} | |
(cd lib; hardlink) | |
(cd lib/dev;hardlink) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment