Last active
August 29, 2015 13:56
-
-
Save ottomata/8939195 to your computer and use it in GitHub Desktop.
symlink files from sha1 names
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
# using this because OS X doesn't have readlink -f :/ | |
alias realpath='python -c "import os,sys; print os.path.realpath(sys.argv[1])" ' | |
artifact_repository_path=/path/to/archiva/repo | |
git_fat_store_path=/path/to/git-fat-store | |
find $artifact_repository_path -type f -name "*.jar" | xargs shasum | while read line; do | |
sum=$(echo $line | awk '{print $1}'); file=$(echo $line | awk '{print $2}'); | |
ln -svf $(realpath $file) $git_fat_store_path/$sum; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment