From 3deedaa389ab67148e1ca55febf919b30fbb4df2 Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Tue, 14 Jul 2020 11:08:58 +0200 Subject: Identify the creation and last update date from the revisions table --- site/cleopatra/soupault.org | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/site/cleopatra/soupault.org b/site/cleopatra/soupault.org index dc23461..18e01d1 100644 --- a/site/cleopatra/soupault.org +++ b/site/cleopatra/soupault.org @@ -361,8 +361,10 @@ https://code.soap.coffee/writing/lthms.git {{#history}} - - + +
{{date}}{{subject}} + {{date}} + {{subject}} {{abbr_hash}} @@ -510,9 +512,16 @@ To manipulate JSON, we rely on three operators (yet to be defined): #+BEGIN_SRC bash :noweb no-export local name="${file}" local revisions='[]' +local first=0 while read -r rev; do rev=$(jset "${rev}" "filename" "\"${name}\"") + + if [ ${first} -eq 0 ]; then + rev=$(jset "${rev}" "modified" "true") + first=1 + fi + revisions=$(jappend "${revisions}" "${rev}") local hash=$(jget "${rev}" "hash") @@ -522,6 +531,8 @@ while read -r rev; do name=${rename} fi done < <(echo "${logs}") + +revisions=$(_jq "${revisions}" "length as \$l | .[\$l - 1].created |= true") #+END_SRC #+BEGIN_SRC bash :tangle scripts/history.sh -- cgit v1.2.3