From 522c00d17186a7f4e1c653d3f60c57144049c388 Mon Sep 17 00:00:00 2001 From: srdusr Date: Thu, 23 May 2024 02:40:17 +0200 Subject: Redirect stdout and stderr to /dev/null to suppress output when updating or cloning dotfiles --- install.sh | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/install.sh b/install.sh index 80b3e52..5c82524 100755 --- a/install.sh +++ b/install.sh @@ -248,19 +248,16 @@ function config { git --git-dir="$dotfiles_dir"/ --work-tree="$HOME" "$@" } -# Check if the $dotfiles_dir directory exists -if [ -d "$dotfiles_dir" ]; then - echo "$dotfiles_dir directory already exists. Updating repository..." - config pull - update=true -else - echo "Cloning dotfiles repository..." - git clone --bare "$dotfiles_url" "$dotfiles_dir" - update=false -fi - # Function to install dotfiles install_dotfiles() { + # Check if the $dotfiles_dir directory exists + if [ -d "$dotfiles_dir" ]; then + config pull >/dev/null 2>&1 + update=true + else + git clone --bare "$dotfiles_url" "$dotfiles_dir" >/dev/null 2>&1 + update=false + fi std_err_output=$(config checkout 2>&1 >/dev/null) || true if [[ $std_err_output == *"following untracked working tree files would be overwritten"* ]]; then @@ -898,10 +895,10 @@ main() { echo "Log File for Dotfiles Installation" >"$LOG_FILE" check_download_dependencies check_os - start_spinner + #start_spinner main_installation handle_complete "Installation completed successfully." - stop_spinner + #stop_spinner } main "$@" -- cgit v1.2.3