Daniel Gibbs 9 lat temu
rodzic
commit
26e5d14f24
2 zmienionych plików z 25 dodań i 25 usunięć
  1. 24 24
      lgsm/functions/command_fastdl.sh
  2. 1 1
      lgsm/functions/core_functions.sh

+ 24 - 24
lgsm/functions/command_fastdl.sh

@@ -115,32 +115,32 @@ fn_fastdl_dirs(){
 
 # Using this gist https://gist.github.com/agunnerson-ibm/efca449565a3e7356906
 fn_human_readable_file_size(){
-    local abbrevs=(
-        $((1 << 60)):ZB
-        $((1 << 50)):EB
-        $((1 << 40)):TB
-        $((1 << 30)):GB
-        $((1 << 20)):MB
-        $((1 << 10)):KB
-        $((1)):bytes
-    )
+	local abbrevs=(
+		$((1 << 60)):ZB
+		$((1 << 50)):EB
+		$((1 << 40)):TB
+		$((1 << 30)):GB
+		$((1 << 20)):MB
+		$((1 << 10)):KB
+		$((1)):bytes
+	)
 
-    local bytes="${1}"
-    local precision="${2}"
+	local bytes="${1}"
+	local precision="${2}"
 
-    if [[ "${bytes}" == "1" ]]; then
-        echo "1 byte"
-    else
-        for item in "${abbrevs[@]}"; do
-            local factor="${item%:*}"
-            local abbrev="${item#*:}"
-            if [[ "${bytes}" -ge "${factor}" ]]; then
-                local size="$(bc -l <<< "${bytes} / ${factor}")"
-                printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}"
-                break
-            fi
-        done
-    fi
+	if [[ "${bytes}" == "1" ]]; then
+		echo "1 byte"
+	else
+		for item in "${abbrevs[@]}"; do
+			local factor="${item%:*}"
+			local abbrev="${item#*:}"
+			if [[ "${bytes}" -ge "${factor}" ]]; then
+				local size="$(bc -l <<< "${bytes} / ${factor}")"
+				printf "%.*f %s\n" "${precision}" "${size}" "${abbrev}"
+				break
+			fi
+		done
+	fi
 }
 
 # Provides info about the fastdl directory content and prompts for confirmation

+ 1 - 1
lgsm/functions/core_functions.sh

@@ -543,7 +543,7 @@ fn_fetch_function
 
 # Creates tmp dir if missing
 if [ ! -d "${tmpdir}" ]; then
-    mkdir -p "${tmpdir}"
+	mkdir -p "${tmpdir}"
 fi
 
 # Calls on-screen messages (bootstrap)