Last active
April 28, 2022 16:06
-
-
Save jldevezas/03213e9b1ead5792ae331b2b41dcd825 to your computer and use it in GitHub Desktop.
Installing LFS for a cloned Git repository when using lfs-filestore
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
#!/bin/bash | |
if [[ $# -lt 1 ]] | |
then | |
echo "Usage: $0 LFS_FOLDERSTORE_PATH" | |
exit 1 | |
fi | |
lfs_folderstore_bin=$(which lfs-folderstore) | |
lfs_folderstore_path=$1 | |
if [[ -z "$lfs_folderstore_bin" ]] | |
then | |
echo "!!! Error: could not find an executable lfs-folderstore, please install it from" \ | |
"https://github.com/sinbad/lfs-folderstore/releases if it's missing, or add the" \ | |
"appropriate permissions" | |
exit 2 | |
fi | |
read -p "Continuing will run 'git reset --hard'. Confirm? [yN] " confirm | |
if [[ -z "$confirm" || "$confirm" != "y" && "$confirm" != "Y" ]] | |
then | |
echo "==> Aborted" | |
exit 3 | |
fi | |
git config --add lfs.customtransfer.lfs-folder.path lfs-folderstore | |
git config --add lfs.customtransfer.lfs-folder.args "$lfs_folderstore_path" | |
git config --add lfs.standalonetransferagent lfs-folder | |
git reset --hard | |
echo "==> Successful" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment