|
#!/bin/bash |
|
source scripts/utils.sh echo -n |
|
|
|
|
|
set -o errexit -o pipefail |
|
|
|
|
|
|
|
|
|
_VERSION=v2.13.3 |
|
|
|
mkdir -p bin/git-lfs-linux-amd64-${_VERSION} |
|
rm -f bin/sha256sums |
|
echo "03197488f7be54cfc7b693f0ed6c75ac155f5aaa835508c64d68ec8f308b04c1 git-lfs-linux-amd64-${_VERSION}.tar.gz" > bin/sha256sums |
|
|
|
files_url=( |
|
"https://github.com/git-lfs/git-lfs/releases/download/${_VERSION}/git-lfs-linux-amd64-${_VERSION}.tar.gz bin/git-lfs-linux-amd64-${_VERSION}.tar.gz") |
|
|
|
git-annex addurl --fast -c annex.largefiles=anything --raw --batch --with-files <<EOF |
|
$(for file_url in "${files_url[@]}" ; do echo "${file_url}" ; done) |
|
EOF |
|
|
|
|
|
|
|
! git-annex get --fast -J8 |
|
|
|
|
|
ls -l $(list) | grep -oE "\.git/[^']*" | \ |
|
cut -d'/' -f7 | xargs -n1 -- find .git/annex/tmp/ -name | \ |
|
while read f |
|
do |
|
newfsize=$(($(stat -c '%s' "${f}") - 1)) |
|
chmod +w "${f}" |
|
truncate -s $newfsize "${f}" |
|
done |
|
|
|
git-annex get --fast --incomplete |
|
git-annex migrate --fast -c annex.largefiles=anything * |
|
(cd bin/ |
|
sha256sum -c sha256sums) || \ |
|
exit_on_error_code "Failed to download git-lfs" |
|
|
|
|
|
tar -C bin/git-lfs-linux-amd64-${_VERSION} -xf bin/git-lfs-linux-amd64-${_VERSION}.tar.gz || \ |
|
exit_on_error_code "Failed to extract git-lfs" |
|
|
|
pushd bin/ >/dev/null |
|
ln -sf git-lfs-linux-amd64-${_VERSION}/git-lfs . |
|
popd >/dev/null |
|
|