karnel-termux 4.9.1 → 4.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/karnel/utils/env.sh +1 -1
- package/karnel/utils/log.sh +16 -8
- package/package.json +1 -1
package/karnel/utils/env.sh
CHANGED
package/karnel/utils/log.sh
CHANGED
|
@@ -556,6 +556,7 @@ progress_start() {
|
|
|
556
556
|
local total=$1
|
|
557
557
|
local message="${2:-Progress}"
|
|
558
558
|
_progress_current=0
|
|
559
|
+
_progress_filled=0
|
|
559
560
|
_progress_total=$total
|
|
560
561
|
_progress_width=50
|
|
561
562
|
printf " ${D_CYAN}%s${D_NC}" "$message"
|
|
@@ -572,15 +573,22 @@ progress_update() {
|
|
|
572
573
|
local current=$1
|
|
573
574
|
local total=$2
|
|
574
575
|
local width="${_progress_width:-50}"
|
|
575
|
-
local
|
|
576
|
-
|
|
577
|
-
local
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
for ((i =
|
|
576
|
+
local target_filled=$((current * width / total))
|
|
577
|
+
|
|
578
|
+
local prev="${_progress_filled:-0}"
|
|
579
|
+
[[ "$target_filled" -lt "$prev" ]] && prev=0
|
|
580
|
+
|
|
581
|
+
local anim i j bar pct
|
|
582
|
+
for ((i = prev + 1; i <= target_filled; i++)); do
|
|
583
|
+
bar=""
|
|
584
|
+
for ((j = 0; j < i; j++)); do bar="${bar}█"; done
|
|
585
|
+
for ((j = i; j < width; j++)); do bar="${bar}░"; done
|
|
586
|
+
pct=$((i * 100 / width))
|
|
587
|
+
printf "\r ${D_CYAN}[${D_NC}${D_GREEN}%s${D_NC}${D_CYAN}]${D_NC} %3d%%" "$bar" "$pct"
|
|
588
|
+
sleep 0.003 2>/dev/null || true
|
|
589
|
+
done
|
|
582
590
|
|
|
583
|
-
|
|
591
|
+
_progress_filled="$target_filled"
|
|
584
592
|
}
|
|
585
593
|
|
|
586
594
|
progress_done() {
|
package/package.json
CHANGED