1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-16 12:21:11 +00:00

Merge branch 'main' of github.com:tw93/Mole

This commit is contained in:
Tw93
2025-12-26 20:45:09 +08:00
2 changed files with 6 additions and 3 deletions

View File

@@ -397,7 +397,10 @@ ensure_user_file() {
# Convert bytes to human-readable format (e.g., 1.5GB) # Convert bytes to human-readable format (e.g., 1.5GB)
bytes_to_human() { bytes_to_human() {
local bytes="$1" local bytes="$1"
[[ "$bytes" =~ ^[0-9]+$ ]] || { echo "0B"; return 1; } [[ "$bytes" =~ ^[0-9]+$ ]] || {
echo "0B"
return 1
}
# GB: >= 1073741824 bytes # GB: >= 1073741824 bytes
if ((bytes >= 1073741824)); then if ((bytes >= 1073741824)); then