More error handling.

This commit is contained in:
2026-04-20 16:57:39 +01:00
parent bff7796f69
commit cec88c7b68

View File

@@ -165,8 +165,9 @@ EOF
EOF EOF
)" )"
done < <(my_curl) done < <(my_curl)
portfolio_index="$( if [ "$portfolio_index" ]; then
cat <<EOF portfolio_index="$(
cat <<EOF
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
@@ -218,8 +219,9 @@ li.language {
$portfolio_index $portfolio_index
</div> </div>
EOF EOF
)" )"
echo "$portfolio_index" > "$tmp_portfolio/index.html" echo "$portfolio_index" > "$tmp_portfolio/index.html"
fi
if [ -d "$directory" ]; then if [ -d "$directory" ]; then
if [ "$(du -sb "$directory" | cut -f1)" -gt $((1024 * 1024 * 400)) ]; then if [ "$(du -sb "$directory" | cut -f1)" -gt $((1024 * 1024 * 400)) ]; then
echo "Error: Directory '$directory' contains more than 400MB of data. Exiting to prevent data loss." echo "Error: Directory '$directory' contains more than 400MB of data. Exiting to prevent data loss."