Use hard links during Sphinx documentation tests

Hard linking the large files in ci/ should be faster than copying them
each time.  Also, let’s only remove them once; the “cleanup” routine was
duplicating work also done at the bottom of the file.
This commit is contained in:
Brandon Rhodes 2020-04-02 09:48:09 -04:00
parent a425df049e
commit da40988fb2
1 changed files with 2 additions and 6 deletions

View File

@ -4,16 +4,12 @@ set -e
cd "$(dirname ${BASH_SOURCE[0]})"
# Copy in files that would otherwise need to download.
cp ci/* skyfield/documentation
ln -f ci/*.* skyfield/documentation
function cleanup {
cd skyfield/documentation
rm -f $(cd ../../ci; ls)
rm -f $(cd ../../ci; ls *.*)
}
trap cleanup EXIT
make -C skyfield/documentation doctest
# Remove the files we copied in.
FILES="$(cd ci; ls *.*)"
(cd skyfield/documentation; rm $FILES)