more stuff

This commit is contained in:
2023-03-20 16:27:43 -07:00
parent 28ab0d57b7
commit b626201d51
8 changed files with 412 additions and 67 deletions

19
scripts/projects-prune.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/bash
# PROJECT DIR PRUNING SCRIPT
printf "%-40s%-20s%s\n" 'Clean git, oldest to newest' 'Date Modified' 'Size'
printf "%-40s%-20s%s\n" '===========================' '=============' '===='
for pdir in $(ls -r1dt */); do
cd $pdir
git status 2> /dev/null | grep 'nothing to commit, working tree clean' 1> /dev/null
if [ "$?" == "0" ]; then
dirModDate=$(date -r . +"%m/%d/%Y")
dirSize=$(du -sh . | awk '{print $1}')
printf "%-40s\e[32m%-20s\e[0m%s\n" $pdir $dirModDate $dirSize
fi
cd ..
done