+
+# Disable SC2116 as we want to echo a space separated list of TOX_ENVS
+# shellcheck disable=SC2116
+for i in .tox/*/log; do
+ tox_env=$(echo "$i" | awk -F'/' '{print $2}')
+ cp -r "$i" "$ARCHIVE_TOX_DIR/$tox_env"
+done
+
+echo "Completed tox runs."
+
+
+# If docs are generated push them to archives.
+DOC_DIR="${DOC_DIR:-docs/_build/html}"
+if [[ -d "$DOC_DIR" ]]; then
+ echo "---> Archiving generated docs"
+ mv "$DOC_DIR" archives/
+fi
+
+test "$tox_status" -eq 0 || exit "$tox_status"