1
0
Fork 0
arangodb/utils/generateREADME.sh

15 lines
405 B
Bash
Executable File

#!/usr/bin/env bash
set -e
IN=${1:-README.md}
OUT=${2:-README}
fgrep -v "[Build Status]" $IN \
| fgrep -v "ArangoDB-Logo" \
| fgrep -v "[Build Status]" \
| markdown \
| html2text -style compact -nobs \
| sed -e 's:>:>:g' \
| awk 'BEGIN { s = 0; } /^\*\*\*\*/ {if (s > 0) print ""} {if (length($0) == 0) {if (s != 0) print $0;} else {s = 1; print $0; }} /^\*\*\*\*/ {print ""}' \
> $OUT