Skip to content

Instantly share code, notes, and snippets.

@ottomata
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottomata/8939195 to your computer and use it in GitHub Desktop.
Save ottomata/8939195 to your computer and use it in GitHub Desktop.
symlink files from sha1 names
# 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