#!/usr/bin/env bash
#set -x

# git-lfs is now in debian
sudo apt-get install git-lfs

## Using in combination with bfg to remove large binary files from a git repo and replace them with a pointer to a uri/url
## debianized repo
## git clone http://github.com/git-lfs/git-lfs
#
##dist=$(lsb_release -c | cut -f2)
#dist=$(cat /etc/devuan_version | awk -F '/' {'print $1'})
#if [ "$dist" == 'jessie' ]; then 
#	RELEASE='jessie'
#elif [ "$dist" == 'ascii' ]; then 
#	RELEASE='stretch'
#elif [ "$dist" == 'beowulf' ]; then 
#	RELEASE='buster'
#elif [ "$dist" == 'chimaera' ]; then
#	RELEASE='bullseye'
#else [ "$dist" == 'ceres' ] 
#	RELEASE='sid'
#fi
#
#echo "Release set to: " ${RELEASE}
#
#RELEASE='buster'
#OS=debian
#
#DEST=/etc/apt/sources.list-available
#LINK=/etc/apt/sources.list.d
#mkdir -p ${DEST}
#mkdir -p ${LINK}
#
#cat > ${DEST}/git-lfs.list << EOF
#deb https://packagecloud.io/github/git-lfs/${OS}/ ${RELEASE} main
#deb-src https://packagecloud.io/github/git-lfs/${OS}/ ${RELEASE} main
#EOF
#
#ln -sfr ${DEST}/git-lfs.list ${LINK}/git-lfs.list
#
#gpg_key_url="https://packagecloud.io/github/git-lfs/gpgkey"
#
#echo -n "Importing packagecloud gpg key... "
#  # import the gpg key
#  KEY_DIR=/etc/apt/keyrings
#  curl -L "${gpg_key_url}" 2> /dev/null | sudo tee ${KEY_DIR}/git-lfs.gpg &>/dev/null
#echo "done."
#
#apt update
#
#apt install -y git-lfs
#apt install -y -f
#
#
#echo "See: http://github.com/git-lfs/git-lfs/wiki/Tutorial"
