more clear
This commit is contained in:
@@ -33,6 +33,8 @@ for part in "${parts[@]}"; do
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if $include; then
|
if $include; then
|
||||||
|
echo "Checking ${part%.yml}..." >&2
|
||||||
|
# Capture stdout (ratio) while letting stderr display naturally
|
||||||
static_ratio="$($BASEPATH/show-static-file-size.sh ${part%.yml})"
|
static_ratio="$($BASEPATH/show-static-file-size.sh ${part%.yml})"
|
||||||
static_ratio="0$static_ratio"
|
static_ratio="0$static_ratio"
|
||||||
total_kb=$($BASEPATH/show-file-size.sh ${part%.yml})
|
total_kb=$($BASEPATH/show-file-size.sh ${part%.yml})
|
||||||
@@ -46,6 +48,7 @@ for part in "${parts[@]}"; do
|
|||||||
static_size=$(echo "$static_size + $static_part" | bc)
|
static_size=$(echo "$static_size + $static_part" | bc)
|
||||||
#output=$(echo "$static_size" | numfmt --to=iec --suffix=B --format="%.2f")
|
#output=$(echo "$static_size" | numfmt --to=iec --suffix=B --format="%.2f")
|
||||||
#echo "$output"
|
#echo "$output"
|
||||||
|
echo "" >&2
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
@@ -22,11 +22,18 @@ for key in $keys; do
|
|||||||
# Print the size of the file or directory
|
# Print the size of the file or directory
|
||||||
size=$(du -sL "$prefix/_data/$path" 2>/dev/null | awk '{print $1}')
|
size=$(du -sL "$prefix/_data/$path" 2>/dev/null | awk '{print $1}')
|
||||||
static_size=$((static_size + size))
|
static_size=$((static_size + size))
|
||||||
# Print the detected path to stderr so it doesn't interfere with ratio output
|
# Format size in human-readable format
|
||||||
echo "$prefix/_data/$path" >&2
|
size_formatted=$(echo "$(( size * 1024 ))" | numfmt --to=iec --suffix=B --format="%.2f")
|
||||||
|
# Print the detected path with size to stderr (one per line)
|
||||||
|
echo "$size_formatted $prefix/_data/$path" >&2
|
||||||
fi
|
fi
|
||||||
done < static-file-path-list.txt
|
done < static-file-path-list.txt
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Print total static size to stderr
|
||||||
|
static_total_formatted=$(echo "$(( static_size * 1024 ))" | numfmt --to=iec --suffix=B --format="%.2f")
|
||||||
|
echo "---" >&2
|
||||||
|
echo "Total static: $static_total_formatted" >&2
|
||||||
|
|
||||||
ratio=$(bc -l <<< "scale=2; $static_size/$total_size")
|
ratio=$(bc -l <<< "scale=2; $static_size/$total_size")
|
||||||
echo "$ratio"
|
echo "$ratio"
|
||||||
|
|||||||
Reference in New Issue
Block a user