From 685f214d1606e95713a8efd05c77f983744d8b9f Mon Sep 17 00:00:00 2001 From: Gal Date: Wed, 14 Feb 2024 22:11:33 +0100 Subject: [PATCH] :hammer: Keep DEST_DIR and SOURCE_DIR in sync --- scripts/publish.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/publish.sh b/scripts/publish.sh index c99c5e8..1921471 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -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"