about summary refs log tree commit diff
path: root/colmena/cobalt/services/gitolite.nix
diff options
context:
space:
mode:
Diffstat (limited to 'colmena/cobalt/services/gitolite.nix')
-rw-r--r--colmena/cobalt/services/gitolite.nix9
1 files changed, 6 insertions, 3 deletions
diff --git a/colmena/cobalt/services/gitolite.nix b/colmena/cobalt/services/gitolite.nix
index 4461a30..459a80e 100644
--- a/colmena/cobalt/services/gitolite.nix
+++ b/colmena/cobalt/services/gitolite.nix
@@ -52,14 +52,17 @@
         age=$(( $system_timestamp - $trash_timestamp ))
         # Wipe trashes older than 2w
         if [[ age -gt 1209600 ]] ; then
-          target_dir=$(rev <<< $dir | cut -d'/' -f2- | rev)
-          echo "Removing '$target_dir' (age $age)"
-          rm -rf $target_dir
+          echo "Removing '$dir' (age $age)"
+          rm -rf $dir
           ((removed_entry+=1))
         fi
         ((processed_entry+=1))
       done
 
+      echo "Directories that needs cleanup:"
+      find Trash -type d -empty -print -delete
+      echo "Cleaned empty directories."
+
       echo "Done! Removed $removed_entry/$processed_entry"
     '';