Skip to content

Commit beaf394

Browse files
committed
Remove temp checkout even when docs creation fails
Currently the server would run out of hd space.
1 parent b853de4 commit beaf394

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

update_docs.sh

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ JSON="${WEBSERVER_PATH}/versions.json"
55

66
TMPDIR=$(mktemp -d -t 'update_docs-XXXXXX')
77
DOC_REPO="$TMPDIR/domjudge"
8+
9+
cleanup()
10+
{
11+
rm -rf "$TMPDIR"
12+
}
13+
14+
trap cleanup EXIT
15+
816
git clone https://github.com/DOMjudge/domjudge.git "$DOC_REPO"
917

1018
for version in $(jq -r -c '.[]' < "${JSON}") ; do
@@ -26,5 +34,3 @@ for version in $(jq -r -c '.[]' < "${JSON}") ; do
2634
cp -r doc/manual/build/html/* "${WEBSERVER_PATH}/${version}/"
2735
)
2836
done
29-
30-
rm -rf "$TMPDIR"

0 commit comments

Comments
 (0)