Create img purge script and apply

This commit is contained in:
thomasabishop 2022-12-27 19:03:42 +00:00
parent 5f40759a5b
commit 9c5fe6a3e0

3
_scripts/clean_image_directory.sh Normal file → Executable file
View file

@ -1,5 +1,6 @@
#!/bin/bash
# If there are images in _img/ that are not being used in the workspace, delete them
find /home/thomas/repos/computer_science/img -type f | while read filename; do
rg "${filename##*/}" ../ --type markdown >/dev/null 2>&1
if [ "$?" -eq 1 ]; then
@ -7,5 +8,3 @@ find /home/thomas/repos/computer_science/img -type f | while read filename; do
rm $filename
fi
done