Skip to content

Commit

Permalink
Makefile: try to make date usage portable
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Aug 15, 2024
1 parent ce60c2d commit 5a2d90f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ rss.xml: blog $(MARKDOWN)
publish: blog
./blog -publish

DAY := $(shell date)
_PARSED_DAY := $(shell date '+%Y-%m-%d' -d '$(DAY)')
DAY := $(shell date '+%Y-%m-%d')
# -d is a GNUism, but sadly -j/-f is a BSDism
# If GNU date extensions doesn't work, just do not try to parse the DAY
_PARSED_DAY := $(shell date '+%Y-%m-%d' -d '$(DAY)' 2>/dev/null || echo '$(DAY)')
.PHONY: day
day:
mkdir -p '$(_PARSED_DAY)'
Expand Down

0 comments on commit 5a2d90f

Please sign in to comment.