🔨 Keep DEST_DIR and SOURCE_DIR in sync

This commit is contained in:
Gal 2024-02-14 22:11:33 +01:00
parent fcccfaff3c
commit 685f214d16
Signed by: gal
GPG Key ID: F035BC65003BC00B
1 changed files with 3 additions and 0 deletions

View File

@ -69,6 +69,9 @@ find -L "$SOURCE_DIR" -type f -name "*.md" -exec grep -q "publish: true" {} \; -
fi
done
# Delete files in DEST_DIR that don't exist in SOURCE_DIR anymore
find "$DEST_DIR" -type f -exec sh -c '[ ! -e "$SOURCE_DIR/${1#$DEST_DIR/}" ] && rm "$1"' _ {} \;
# Print the log file
cat "$LOG_FILE"