slog/add-docs-to-readme.sh
2021-04-29 09:22:39 -07:00

9 lines
242 B
Bash
Executable File

#! /bin/bash
set -e
slogdir=$(dirname "$0")
readme="$slogdir/README.md"
awk '/## Documentation/ {print ; exit} {print}' "$readme" > "$readme.tmp" && go doc -all slog | sed "s/^/ /;s/[ \t]*$//" >> "$readme.tmp"
mv "$readme.tmp" "$readme"