forked from lix-project/lix
Assume yes if we have no TTY
Starve the TTY of input to ensure this works, but provide yes to the current installer to handle the current broken case.
This commit is contained in:
parent
73a57a2f22
commit
1c7ce2a018
|
@ -43,6 +43,12 @@ readonly EXTRACTED_NIX_PATH="$(dirname "$0")"
|
||||||
|
|
||||||
readonly ROOT_HOME="/var/root"
|
readonly ROOT_HOME="/var/root"
|
||||||
|
|
||||||
|
if [ -t 0 ]; then
|
||||||
|
readonly IS_HEADLESS='no'
|
||||||
|
else
|
||||||
|
readonly IS_HEADLESS='yes'
|
||||||
|
fi
|
||||||
|
|
||||||
contactme() {
|
contactme() {
|
||||||
echo "We'd love to help if you need it."
|
echo "We'd love to help if you need it."
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -173,6 +179,11 @@ failure() {
|
||||||
ui_confirm() {
|
ui_confirm() {
|
||||||
_textout "$GREEN$GREEN_UL" "$1"
|
_textout "$GREEN$GREEN_UL" "$1"
|
||||||
|
|
||||||
|
if [ "$IS_HEADLESS" = "yes" ]; then
|
||||||
|
echo "No TTY, assuming you would say yes :)"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
local prompt="[y/n] "
|
local prompt="[y/n] "
|
||||||
echo -n "$prompt"
|
echo -n "$prompt"
|
||||||
while read -r y; do
|
while read -r y; do
|
||||||
|
|
|
@ -53,7 +53,8 @@ trap finish EXIT
|
||||||
|
|
||||||
# First setup Nix
|
# First setup Nix
|
||||||
cleanup
|
cleanup
|
||||||
curl https://nixos.org/nix/install | bash
|
curl -o install https://nixos.org/nix/install
|
||||||
|
yes | bash ./install
|
||||||
verify
|
verify
|
||||||
|
|
||||||
|
|
||||||
|
@ -82,7 +83,7 @@ verify
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|
||||||
yes | ./install
|
echo -n "" | ./install
|
||||||
verify
|
verify
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
|
|
Loading…
Reference in a new issue