File tree Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Expand file tree Collapse file tree 1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change 33
33
USE_SUDO=false
34
34
fi
35
35
36
- # Check if docs-builder already exists
36
+ # Check if docs-builder already exists, but handle non-interactive shells
37
37
if [ -f " $INSTALL_DIR /docs-builder" ]; then
38
38
echo " docs-builder is already installed."
39
- printf " Do you want to update/overwrite it? (y/n): "
40
- read choice
41
- case " $choice " in
42
- y|Y ) echo " Updating docs-builder..." ;;
43
- n|N ) echo " Installation aborted." ; exit 0 ;;
44
- * ) echo " Invalid choice. Installation aborted." ; exit 1 ;;
45
- esac
39
+
40
+ # Check if script is running interactively (has a TTY)
41
+ if [ -t 0 ]; then
42
+ # Running interactively, can prompt for input
43
+ printf " Do you want to update/overwrite it? (y/n): "
44
+ read choice
45
+ case " $choice " in
46
+ y|Y ) echo " Updating docs-builder..." ;;
47
+ n|N ) echo " Installation aborted." ; exit 0 ;;
48
+ * ) echo " Invalid choice. Installation aborted." ; exit 1 ;;
49
+ esac
50
+ else
51
+ # Non-interactive mode (e.g., piped from curl), default to yes
52
+ echo " Running in non-interactive mode. Proceeding with installation..."
53
+ fi
46
54
fi
47
55
48
56
echo " Downloading docs-builder for $OS /$ARCH ..."
You can’t perform that action at this time.
0 commit comments