diff options
author | Alexander Foremny <aforemny@posteo.de> | 2023-09-28 16:38:51 +0200 |
---|---|---|
committer | Alexander Foremny <aforemny@posteo.de> | 2023-09-28 16:38:51 +0200 |
commit | 1f9282020f19a3e9826d976e639cf9f9700db331 (patch) | |
tree | 16fcc1a7f22f685dc016e9dac10023c59205286c /src/extract.sh | |
parent | 699e7c59ef8cebdb9721b31c3f6eb58588bd6dc1 (diff) |
split augmentation and output into separate passes
Diffstat (limited to 'src/extract.sh')
-rwxr-xr-x | src/extract.sh | 23 |
1 files changed, 23 insertions, 0 deletions
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) |