diff --git a/blag b/blag index 4f18101..c922afe 100755 --- a/blag +++ b/blag @@ -90,11 +90,14 @@ render() {( path=$1 shift - birth=$(stat -c'%W' "$path") - if (( birth > 0 )); then - CREATED_AT=$(date --rfc-3339=seconds -d "@$birth") + if (( ! DATES_CALCULATED )); then + birth=$(stat -c'%W' "$path") + if (( birth > 0 )); then + CREATED_AT=$(date --rfc-3339=seconds -d "@$birth") + fi + MODIFIED_AT=$(date --rfc-3339=seconds -d "@$(stat -c '%Y' "$path")") + DATES_CALCULATED=1 fi - MODIFIED_AT=$(date --rfc-3339=seconds -d "@$(stat -c '%Y' "$path")") #shellcheck disable=SC1090 . "$path" "$@"