From 96cda9951d97e7c2c76fda5dcac8988c8c653253 Mon Sep 17 00:00:00 2001 From: Filip Gralinski Date: Tue, 22 Feb 2022 17:32:16 +0100 Subject: [PATCH] Get new script --- annex-get-all.sh | 11 ----------- get-annexed-files.sh | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) delete mode 100755 annex-get-all.sh create mode 100755 get-annexed-files.sh diff --git a/annex-get-all.sh b/annex-get-all.sh deleted file mode 100755 index 54c5ecf..0000000 --- a/annex-get-all.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -git annex init - -for file in images/*.png -do - url=https://re-research.pl/git-annex-storage/fiszki-ocr/$file - echo $url $file -done | git annex addurl --batch --with-files - -git annex get images/*.png diff --git a/get-annexed-files.sh b/get-annexed-files.sh new file mode 100755 index 0000000..d9819b0 --- /dev/null +++ b/get-annexed-files.sh @@ -0,0 +1,26 @@ +#!/bin/sh -e + + +if ! command -v git-annex > /dev/null +then + echo >&2 "git-annex not available, you need to install it" + exit 1 +fi + +# Just in case the repo was cloned with --single-branch option +git config remote.origin.fetch refs/heads/*:refs/remotes/origin/* + +git annex init +git annex sync -a --no-push + +if ! git annex enableremote gonito-https +then + echo >&2 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + echo >&2 "Setting httpalso failed, likely because you have an outdated version of git-annex" + echo >&2 "See https://git-annex.branchable.com/install/" + echo >&2 "Probably the easiest way is to use conda: conda install -c conda-forge git-annex" + echo >&2 "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" + exit 1 +fi + +git annex get $@ --from gonito-https