diff options
| author | EuAndreh <eu@euandre.org> | 2020-08-28 20:52:08 -0300 |
|---|---|---|
| committer | EuAndreh <eu@euandre.org> | 2020-08-28 22:01:44 -0300 |
| commit | 97bf1ea1dabddc212c5ee8858213efe1f2251f6c (patch) | |
| tree | ba0b36bb9b95d7beef5de424a138a94a6e664267 /ci-gen-index.sh | |
| parent | Add $lang prefix to root songbooks documentation path redirect (diff) | |
| download | toph-97bf1ea1dabddc212c5ee8858213efe1f2251f6c.tar.gz toph-97bf1ea1dabddc212c5ee8858213efe1f2251f6c.tar.xz | |
Add ci-logs from static files
Diffstat (limited to 'ci-gen-index.sh')
| -rwxr-xr-x | ci-gen-index.sh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/ci-gen-index.sh b/ci-gen-index.sh new file mode 100755 index 0000000..2c9f777 --- /dev/null +++ b/ci-gen-index.sh @@ -0,0 +1,57 @@ +#!/usr/bin/env bash +set -Eeuo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")" + +printf "Generating index.html of build logs... " +rm -f index.html + +cat <<EOF >> index.html +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="UTF-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1" /> + + <style> + pre { + display: inline; + } + </style> + </head> + <body> + <h1> + Build logs + </h1> +EOF + +for dir in */; do + d="${dir%/}" + cat <<EOF >> index.html + <h2 id="$d"> + <a href="#$d"> + $dir + </a> + </h2> + <ul> +EOF + for file in "$d"/*; do + cat <<EOF >> index.html + <li> + <a href="$file"> + <pre>$file</pre> + </a> + </li> +EOF + done + + cat <<EOF >> index.html + </ul> +EOF +done + +cat <<EOF >> index.html + </body> +</html> +EOF + +echo "done." |
