diff options
Diffstat (limited to 'dot-backup.sh')
| -rwxr-xr-x | dot-backup.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/dot-backup.sh b/dot-backup.sh index 0e22d70..f58c873 100755 --- a/dot-backup.sh +++ b/dot-backup.sh @@ -160,10 +160,20 @@ DOTFILES=( "/etc/bash_completion.d" ) -# Load external list if it exists, appending to built-in list +# Use external list exclusively if it exists and is non-empty +_has_external_list=false if [[ -f "$DOTFILES_LIST" ]]; then while IFS= read -r line || [[ -n "$line" ]]; do [[ "$line" =~ ^#.*$ || -z "$line" ]] && continue + _has_external_list=true + break + done < "$DOTFILES_LIST" +fi + +if [[ "$_has_external_list" == true ]]; then + DOTFILES=() + while IFS= read -r line || [[ -n "$line" ]]; do + [[ "$line" =~ ^#.*$ || -z "$line" ]] && continue DOTFILES+=("$line") done < "$DOTFILES_LIST" fi |
