summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbuild10
1 files changed, 7 insertions, 3 deletions
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 <<EOF >> 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 <<EOF >> 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