From 88c9b4f1b93922d9ee70c6c64c4b846b4080ce30 Mon Sep 17 00:00:00 2001 From: Marley Rae Date: Mon, 22 Jan 2024 21:02:43 -0800 Subject: [PATCH] :bug: Small fixes to main install scripts Add ask_for_sudo back to dot.sh; fix show_spinner & execute in utils.sh. --- script/dot.sh | 5 ++++- script/utils.sh | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/script/dot.sh b/script/dot.sh index 72eb0b7..eeff80d 100755 --- a/script/dot.sh +++ b/script/dot.sh @@ -290,7 +290,6 @@ restart_os() printf "\n" if answer_is_yes; then - ask_for_sudo sudo shutdown -r now &> /dev/null fi } @@ -321,6 +320,10 @@ main() # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + ask_for_sudo + + # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + # Check if this script was run directly, and if not, dotfiles will need to be # downloaded. diff --git a/script/utils.sh b/script/utils.sh index 4d3ec53..62319e7 100755 --- a/script/utils.sh +++ b/script/utils.sh @@ -164,7 +164,7 @@ show_spinner() tput sc while kill -0 "$PID" &> /dev/null; do - frame_text=" [${FRAMES:i++%NUMBER_OF_FRAMES:1}] $MSG" + frame_text=" [${FRAMES:i++%NUMBER_OF_FRAMES:1}] $MSG" # Print frame text. printf "%s" "$frame_text" @@ -237,7 +237,7 @@ execute() # Print output based on what happened. print_result $exit_code "$MSG" - if [[ $exit -ne 0 ]]; then + if [[ $exit_code -ne 0 ]]; then print_error_stream < "$TMP_FILE" fi