Skip to content

Commit 8550f84

Browse files
committed
path resolution fix
1 parent 0173170 commit 8550f84

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/validate_posts.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ for file in _posts/*.md; do
2323
fi
2424

2525
# Extract and validate date
26+
# Try GNU date (Linux) or BSD date (macOS) - either one succeeding is valid
2627
date_part="${filename:0:10}"
27-
if ! date -d "$date_part" "+%Y-%m-%d" > /dev/null 2>&1 && \
28-
! date -j -f "%Y-%m-%d" "$date_part" > /dev/null 2>&1; then
28+
if ! ( date -d "$date_part" "+%Y-%m-%d" >/dev/null 2>&1 || \
29+
date -j -f "%Y-%m-%d" "$date_part" >/dev/null 2>&1 ); then
2930
echo "✗ Invalid date in filename: $filename"
3031
((error_count++))
3132
continue

0 commit comments

Comments
 (0)