diff options
Diffstat (limited to 'src/extract-generic.sh')
-rwxr-xr-x | src/extract-generic.sh | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/extract-generic.sh b/src/extract-generic.sh index 0c84ec1..cadbb30 100755 --- a/src/extract-generic.sh +++ b/src/extract-generic.sh @@ -33,8 +33,21 @@ tree-grepper \ text=$(echo "$item" | jq .match.text -r | sed 's/^'"$LINE_COMMENT_START"' *TODO *//' | - sed 's/^'"$BLOCK_COMMENT_START"' *TODO *//' | - sed 's/ *'"$BLOCK_COMMENT_END"'$//') + { + if test -z "${BLOCK_COMMENT_START-}"; then + cat + else + sed 's/^'"$BLOCK_COMMENT_START"' *TODO *//' + fi + } | + { + if test -z "${BLOCK_COMMENT_END-}"; then + cat + else + sed 's/ *'"$BLOCK_COMMENT_END"'$//' + fi + } + ) echo "$item" | jq '. + {"text": $text, "last_commit": $last_commit}' \ --arg text "$text" \ |