浏览代码

fix: Progress

Kroese 1 年之前
父节点
当前提交
dc7a1a667a
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      src/install.sh

+ 7 - 0
src/install.sh

@@ -6,6 +6,13 @@ set -Eeuo pipefail
 BASE="$VERSION.iso"
 [ -f "$STORAGE/$BASE" ] && return 0
 
+# Check if running with interactive TTY or redirected to docker log
+if [ -t 1 ]; then
+  PROGRESS="--progress=bar:noscroll"
+else
+  PROGRESS="--progress=dot:giga"
+fi
+
 URL="https://raw.githubusercontent.com/ElliotKillick/Mido/main/Mido.sh"
 { wget "$URL" -O "$STORAGE/Mido.sh" -q --no-check-certificate; rc=$?; } || :