Terminal interface to find, download, and stream movies, TV shows, and live TV using local media players.
fix(install): enable TTY detection, screen clearing, and interactive prompts when piped via curl
Samir Hossains47f27fba7e97
diff --git a/install.sh b/install.shindex e698148..4dfeadf 100755--- a/install.sh+++ b/install.sh@@ -64,7 +64,7 @@ EOFdoneIS_TTY=0-if [ -t 1 ] && [ -t 0 ]; then+if [ -t 1 ]; thenIS_TTY=1fi@@ -372,7 +372,11 @@ if [ -n "$EXISTING_BIN" ] && [ -x "$EXISTING_BIN" ]; thenif [ "$IS_TTY" -eq 1 ] && [ "$DRY_RUN" -eq 0 ]; thenprintf "\n %b%s%b %b%s%b\n" "$C_YELLOW" "ℹ" "$C_RESET" "$C_TEXT" "MovieBox-TUI $TARGET_VERSION is already installed at $EXISTING_BIN." "$C_RESET"printf " Choose an action: [1] Reinstall [2] Uninstall [3] Exit: "- read -r user_choice || user_choice="3"+ if [ -e /dev/tty ]; then+ read -r user_choice </dev/tty || user_choice="3"+ else+ read -r user_choice || user_choice="3"+ ficase "$user_choice" in1)log_step "Proceeding with reinstall..."@@ -405,7 +409,7 @@ URL="https://github.com/$REPO/releases/download/$TARGET_VERSION/$FILE"CHECKSUM_URL="https://github.com/$REPO/releases/download/$TARGET_VERSION/SHA256SUMS"download_files() {- curl -fSL "$URL" -o "$TMP_DIR/$FILE" && \+ curl -fsSL "$URL" -o "$TMP_DIR/$FILE" && \curl -fsSL "$CHECKSUM_URL" -o "$TMP_DIR/SHA256SUMS"}