added auto yes answer

This commit is contained in:
Jonas Forsberg 2020-08-02 09:23:41 +02:00
parent 10b86f447b
commit cd97c5e46a
No known key found for this signature in database
GPG Key ID: F2E9818C70350CC9

View File

@ -2,6 +2,8 @@
# Set up my desktop/laptop with all default setttings that I want. # Set up my desktop/laptop with all default setttings that I want.
# #
# uses salt-call masterless configuration. # uses salt-call masterless configuration.
#
# to auto answer YES set the INITDESKTOP_YES=1 environment variable
DOTFILES_REPO="$HOME/.dotfiles" DOTFILES_REPO="$HOME/.dotfiles"
DOTFILES_REMOTE="https://git.rre.nu:443/jonas/dotfiles.git" DOTFILES_REMOTE="https://git.rre.nu:443/jonas/dotfiles.git"
@ -11,6 +13,9 @@ DOTFILES_REMOTE="https://git.rre.nu:443/jonas/dotfiles.git"
set -aeo pipefail set -aeo pipefail
function asktobreak(){ function asktobreak(){
if [[ "$INITDESKTOP_YES" == 1 ]];then
return 1
fi
printf "Do you want to run this step (y/n)" printf "Do you want to run this step (y/n)"
while read -r -n 1 -s answer; do while read -r -n 1 -s answer; do
if [[ $answer == [YyNn] ]];then if [[ $answer == [YyNn] ]];then