Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
scripts: Small improvement to `cache-cobs`
cloudhead committed 1 year ago
commit bc142296398cc6686b68c4aef652046a8eb62aaf
parent 4e112aaeaad8919c10f0a30c9f43dab541d653fa
1 file changed +13 -5
modified scripts/cache-cobs
@@ -1,11 +1,19 @@
#!/bin/sh
+
set -e

DIRECTORY="$(rad path)/storage"

+
if [ ! -d "$DIRECTORY" ]; then
+
  echo "Error: Directory $DIRECTORY does not exist or is not accessible."
+
  exit 1
+
fi
+

for repo in "$DIRECTORY"/*; do
-
  repo="rad:$(basename $repo)"
-
  echo "Processing $repo.."
-
  rad issue cache --repo "$repo"
-
  rad patch cache --repo "$repo"
-
  echo
+
  if [ -d "$repo" ]; then
+
    rid=$(basename "$repo")
+
    echo "Processing rad:$rid.."
+
    rad issue cache --repo "rad:$rid"
+
    rad patch cache --repo "rad:$rid"
+
    echo
+
  fi
done