Autosave: 2024-03-01 09:02:17

This commit is contained in:
thomasabishop 2024-03-01 09:02:17 +00:00
parent 5a2353dbaa
commit bb1e3a7051
2 changed files with 3 additions and 3 deletions

View file

@ -29,4 +29,4 @@ git pull >/dev/null 2>&1
git add . git add .
git commit -q -m "Autosave: $(date +"%Y-%m-%d %H:%M:%S")" git commit -q -m "Autosave: $(date +"%Y-%m-%d %H:%M:%S")"
git push git push
notify-send "Auto-save complete" "Changes committed to remote repository" notify-send "Auto-save complete" "Zettelkasten changes committed to remote repository"

View file

@ -3,13 +3,13 @@
# If there are images in img/ that are not being used by the Zettelkasten, delete them # If there are images in img/ that are not being used by the Zettelkasten, delete them
# Loop through /img directory # Loop through /img directory
find "${EOLAS_PATH}/img" -type f | while read filename; do find "/home/thomas/repos/eolas/img" -type f | while read filename; do
# Check each .md file in ZK for image # Check each .md file in ZK for image
search_result=$(rg "${filename##*/}" "${EOLAS_PATH}/zk" --type markdown) search_result=$(rg "${filename##*/}" "${EOLAS_PATH}/zk" --type markdown)
# If the image is not found in any file, delete it # If the image is not found in any file, delete it
if [ -z "$search_result" ]; then if [ -z "$search_result" ]; then
echo "Deleted unused image: ${filename##*/}" echo "Deleted unused image: ${filename##*/}"
rm $filename # rm $filename
fi fi
done done