diff options
| author | srdusr <trevorgray@srdusr.com> | 2024-05-23 02:40:17 +0200 |
|---|---|---|
| committer | srdusr <trevorgray@srdusr.com> | 2024-05-23 02:40:17 +0200 |
| commit | 522c00d17186a7f4e1c653d3f60c57144049c388 (patch) | |
| tree | 075e1ff979bf01b894f38ecf7d2a654dbfbaf311 /install.sh | |
| parent | 13a4c9ee0f535fa1780e523ef26d4e46cbec7d91 (diff) | |
| download | dotfiles-522c00d17186a7f4e1c653d3f60c57144049c388.tar.gz dotfiles-522c00d17186a7f4e1c653d3f60c57144049c388.zip | |
Redirect stdout and stderr to /dev/null to suppress output when updating or cloning dotfiles
Diffstat (limited to 'install.sh')
| -rwxr-xr-x | install.sh | 23 |
1 files changed, 10 insertions, 13 deletions
@@ -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 "$@" |
