#!/usr/bin/env bash

set -eo pipefail

downloadURL="https://github.com/git-lfs/git-lfs/releases/download/v${GIT_LFS_VERSION}/git-lfs-linux-amd64-v${GIT_LFS_VERSION}.tar.gz"

wget "${downloadURL}" -O /tmp/git-lfs.tar.gz

echo "${GIT_LFS_AMD64_CHECKSUM}  /tmp/git-lfs.tar.gz" > /tmp/checksums
sha256sum -c /tmp/checksums

tar -xzf /tmp/git-lfs.tar.gz -C /tmp
cp /tmp/git-lfs-${GIT_LFS_VERSION}/git-lfs /usr/local/bin
chmod +x /usr/local/bin/git-lfs

git-lfs install --skip-repo

rm -rf /tmp/*
