From 967486dd716de860db3ef091a9dcb9cb65023534 Mon Sep 17 00:00:00 2001 From: Chris Bandy Date: Sat, 25 Jan 2020 09:54:44 -0600 Subject: Combine ftdetect files in a predictable order (#461) Bash expands patterns to an alphabetically sorted list of filenames, but the order depends on LC_COLLATE. On both Linux and BSD, `sort -V` uses the C locale. --- build | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'build') diff --git a/build b/build index 6ef3f5fd..3b87675c 100755 --- a/build +++ b/build @@ -72,8 +72,11 @@ extract() { continue fi - [ -d "${dir}${subtree:-/}ftdetect" ] && for f in "${dir}${subtree:-/}ftdetect/"*; do - cat <> tmp/polyglot.vim + ftdetect=("${dir}${subtree:-/}ftdetect"/*) + if [ "$ftdetect" ] && [ "$ftdetect" != "${dir}${subtree:-/}ftdetect/*" ]; then + IFS=$'\n' ftdetect=($(sort -V <<< "${ftdetect[*]}")); unset IFS + for f in "${ftdetect[@]}"; do + cat <> tmp/polyglot.vim if !exists('g:polyglot_disabled') || index(g:polyglot_disabled, '${pack%%:*}') == -1 augroup filetypedetect " ${pack%%:*}, from ${f##*/ftdetect/} in ${pack#*:} @@ -82,7 +85,8 @@ $(cat "${f}") endif EOF - done + done + fi done -- cgit v1.2.3