From 50dc2748ca7a3304a7e2e4accebc1c1e835439d3 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Tue, 17 Oct 2023 16:36:01 +0300 Subject: [s2] Fixed logic for timestamps --- csg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/csg b/csg index cc0f9eb..ad2d41c 100755 --- a/csg +++ b/csg @@ -232,12 +232,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" ' + local timestamps=($($CSG_AWK -v file="$outf" ' BEGIN { FS = "\t" } $1 == file { print $2 exit - }' "$file")) + }' "$CSG_TIMESTAMP_FILE")) # Generate $CSG_MD_TO_HTML "$file" > "$outf" @@ -247,8 +247,8 @@ transform-file() { -v title="$title" \ -v description="$descr" \ -v words="$words" \ - -v created="${timestamps[@]:0:3}" \ - -v edited="${timestamps[@]:4}" \ + -v created="${timestamps[*]:0:3}" \ + -v edited="${timestamps[*]:3}" \ $scr_libs $scripts -f "$CSG_TMP_DIR/csg-print.awk" \ "$outf" > "$outf.tmp" mv "$outf.tmp" "$outf" -- cgit v1.3.1-23-gd82d