]> gitweb.fluxo.info Git - hydra.git/commitdiff
Fix: hydractl: sync-media:improved lock file handling (3)
authorSilvio Rhatto <rhatto@riseup.net>
Sat, 27 Sep 2025 20:50:51 +0000 (17:50 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sat, 27 Sep 2025 20:50:51 +0000 (17:50 -0300)
share/hydractl/sync-media

index c8eed1237d02a0c1a68db76bd2a4321d1bfa504d..56f74c96ab701e4b7947152baaa3f8216074f281 100755 (executable)
@@ -49,8 +49,8 @@ function sync_media_set_lockfile {
 # Remove lockfile
 # Adapted from borger
 function sync_media_unset_lockfile {
-  if [ ! -z "$LOCKFILE" ]; then
-    git annex unannex $LOCK
+  if [ ! -z "$LOCKFILE" ] && [ -e "$LOCKFILE" ]; then
+    git annex unannex $LOCK &> /dev/null
     git rm -f $LOCKFILE &> /dev/null || \
       rm -f $LOCKFILE || echo "Could not remove lockfile $LOCKFILE"
   fi