diff options
| Commit | 57e9d1666dcaae4d952a166d3af1c67aa1b1b251 (patch) | |
|---|---|---|
| Author | 2023-10-17 15:49:26 +0300 | |
| Committer | 2023-10-17 15:49:26 +0300 | |
| Files | b03f093c32383cb679aff16a8a65fcc3acb0721b | |
| csg-57e9d1666dcaae4d952a166d3af1c67aa1b1b251.tar csg-57e9d1666dcaae4d952a166d3af1c67aa1b1b251.tar.gz csg-57e9d1666dcaae4d952a166d3af1c67aa1b1b251.zip | ||
| Parent | d27f236814171d6913f4c9390010354fc30bba18 (diff) | |
[s2] Timestamps are now passed as variables to scripts
1 files changed, 9 insertions, 1 deletions
| -rwxr-xr-x | csg | 10 |
@@ -128,7 +128,7 @@ then for file in $(find . -type f -name '*.md') do dates=($(git log --follow --pretty=format:%ad --date="format:%d %B %Y" -- "$file")) - line="$DESTINATION${file:1:-2}html\t${dates[@]: -3:3}\t${dates[@]:0:3}" + line="$DESTINATION${file:1:-2}html\t${dates[@]: -3:3} ${dates[@]:0:3}" echo -e "$line" >> "$CSG_TIMESTAMP_FILE" done } @@ -229,6 +229,12 @@ transform-file() { startedGathering && /^$/ { exit } END { print desc }' "$file")" local words="$($CSG_AWK '{total += NF} END{print total}' "$file")" + local timestamps=($($CSG_AWK -v file="$file" ' + BEGIN { FS = "\t" } + $1 == file { + print $2 + exit + }' "$file")) # Generate $CSG_MD_TO_HTML "$file" > "$outf" @@ -238,6 +244,8 @@ transform-file() { -v title="$title" \ -v description="$descr" \ -v words="$words" \ + -v created="${timestamps[@]:0:3}" \ + -v edited="${timestamps[@]:4}" \ $scr_libs $scripts -f "$CSG_TMP_DIR/csg-print.awk" \ "$outf" > "$outf.tmp" mv "$outf.tmp" "$outf" |
