diff --git a/dotfiles/.local/bin/config.sh b/dotfiles/.local/bin/config.sh index db2b67f..9601307 100755 --- a/dotfiles/.local/bin/config.sh +++ b/dotfiles/.local/bin/config.sh @@ -9,28 +9,15 @@ find_config_file() { fi local config_files=($(find -L "$XDG_CONFIG_HOME" \( -name "$program*" -o -name ".$program*" \) -type f)) - #local config_files=($(find -L "$XDG_CONFIG_HOME" -name "$program*" -type f)) if [ ${#config_files[@]} -gt 0 ]; then local min_subfolder_count=10 for file in "${config_files[@]}"; do subfolder_count=$(echo "$file" | awk -F/ '{print NF-2}') - #if [ -z "$config_file" ] || [ "$subfolder_count" -lt "$min_subfolder_count" ]; then if [ -z "$config_file" ] || { [ "$subfolder_count" -lt "$min_subfolder_count" ] || { [ "$subfolder_count" -eq "$min_subfolder_count" ] && [ "$(basename "$file")" == "$program.${file##*.}" ]; }; }; then min_subfolder_count="$subfolder_count" config_file="$file" fi done - - #exact_match_files=() - #for file in "${config_files[@]}"; do - # if [ "$(basename "$file")" == "$program.${file##*.}" ]; then - # exact_match_files+=("$file") - # fi - #done - - #if [ ${#exact_match_files[@]} -gt 0 ]; then - # config_file="${exact_match_files[0]}" - #fi fi if [ -z "$config_file" ]; then