From 1f9282020f19a3e9826d976e639cf9f9700db331 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Thu, 28 Sep 2023 16:38:51 +0200 Subject: split augmentation and output into separate passes --- src/extract.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/extract.sh b/src/extract.sh index 800cb8f..1e8440d 100755 --- a/src/extract.sh +++ b/src/extract.sh @@ -100,6 +100,29 @@ git ls-files --cached --exclude-standard --other | {sub("^ {1,"n"}", ""); print}' ) + echo "$item" | jq -c \ + --arg body "$body" \ + --arg created_at "$created_at" \ + --arg first_commit "$first_commit" \ + --arg heading "$heading" \ + --argjson end_row "$end_row" \ + --argjson start_row "$start_row" \ + '. + { + "body": $body, + "created_at": $created_at, + "end_row": $end_row, + "first_commit": $first_commit, + "heading": $heading, + "start_row": $start_row + }' + done | while read -r item; do + created_at=$(echo "$item" | jq -r .created_at) + file=$(echo "$item" | jq -r .file) + heading=$(echo "$item" | jq -r .heading) + body=$(echo "$item" | jq -r .body) + start_row=$(echo "$item" | jq -r .start_row) + end_row=$(echo "$item" | jq -r .end_row) + GREEN='\033[0;32m' BOLD=$(tput bold) NORMAL=$(tput sgr0) -- cgit v1.2.3