File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -Eeuo pipefail
33
4- SCRIPT_VERSION=" 1.1.0 "
4+ SCRIPT_VERSION=" 1.1.1 "
55
66SERVICE_NAME=" ${SERVICE_NAME:- multi-command-runner} "
77INSTALL_DIR=" ${INSTALL_DIR:-/ opt/ multi-command-runner} "
@@ -82,6 +82,10 @@ prompt_yes_no() {
8282 done
8383}
8484
85+ has_interactive_tty () {
86+ tty -s && [[ -r /dev/tty && -w /dev/tty ]]
87+ }
88+
8589resolve_data_dir () {
8690 if [[ -z " ${DATA_DIR} " && -f " ${ENV_FILE} " ]]; then
8791 DATA_DIR=" $( grep -E " ^[[:space:]]*DATA_DIR=" " ${ENV_FILE} " | tail -n 1 | cut -d' =' -f2- || true) "
@@ -103,7 +107,7 @@ configure_options() {
103107 if [[ " ${FORCE} " == " 1" ]]; then
104108 return
105109 fi
106- if [[ ! -r /dev/tty || ! -w /dev/tty ]] ; then
110+ if ! has_interactive_tty ; then
107111 warn " No interactive TTY detected. Using default/specified uninstall options."
108112 return
109113 fi
You can’t perform that action at this time.
0 commit comments