diff --git a/.gitignore b/.gitignore index 1ba24b87..af701185 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ compiler/**/*.js .*.generated.ts .tmp/ .DS_Store +.build_cache/ diff --git a/scripts/authors.sh b/scripts/authors.sh index d0d9ead4..415d1d84 100755 --- a/scripts/authors.sh +++ b/scripts/authors.sh @@ -4,10 +4,18 @@ set -e err() { echo "error: line $(caller)"; } trap err ERR +mkdir -p .build_cache cd src/static authors="../../build/static/authors.html" sed "/REPLACETHIS/,$ d" authors.html > "$authors" -git shortlog -sn HEAD | cut -c8- | awk '!seen[$0]++' | sed 's/^/
/' | sed 's/$/<\/p>/' >> "$authors" + +# If we're in a git repo, refresh the cache +if [ -d "../../.git/" ]; then + git shortlog -sn HEAD | cut -c8- | awk '!seen[$0]++' | sed 's/^/
/' | sed 's/$/<\/p>/' > ../../.build_cache/authors +fi + +cat ../../.build_cache/authors >> "$authors" + sed "1,/REPLACETHIS/ d" authors.html >> "$authors"