diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2023-01-01 16:03:34 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2023-01-01 16:03:34 -0300 |
commit | 08283dceeb64eaaf8aafed7913adcbdc1ad22ba1 (patch) | |
tree | b8bd50f05bd919f1fd3d6f165c55903ede2ab33a | |
parent | d2cf9cb06f3ee4d50071b6e56f28a50f4133c166 (diff) | |
download | scripts-08283dceeb64eaaf8aafed7913adcbdc1ad22ba1.tar.gz scripts-08283dceeb64eaaf8aafed7913adcbdc1ad22ba1.tar.bz2 |
Minor copy-annotations-from-kobo enhancements
-rwxr-xr-x | copy-annotations-from-kobo | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/copy-annotations-from-kobo b/copy-annotations-from-kobo index 40ad9e8..271328f 100755 --- a/copy-annotations-from-kobo +++ b/copy-annotations-from-kobo @@ -34,9 +34,18 @@ show --search "$PATTERN" | while read item; do extension="$(echo $item | sed -e "s|$basename.||")" sdr="$basename.sdr" + # Make sure that the annotation file exists mkdir -p "$BASEFOLDER/$sdr" touch "$BASEFOLDER/$sdr/metadata.$extension.lua" + + # Make sure it's not locked by git annex + git annex unlock "$BASEFOLDER/$sdr/metadata.$extension.lua" + + # Update silentSsh kobo >"$BASEFOLDER/$sdr/metadata.$extension.lua" <<EOF cat "$REMOTE_BASE/$sdr/metadata.$extension.lua" EOF + + # Stage + git add "$REMOTE_BASE/$sdr/metadata.$extension.lua" done |