summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2020-10-16 14:08:54 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2020-10-16 14:08:54 +0200
commit8f9e5ac70b3492b1385ed01d832f51388d643275 (patch)
tree02a4dde67d5d1447f4f35b4cfa35d2e13bac717e /scripts
parent23d7b0931d41f1205bd284d81dc04ceb4c1615fb (diff)
downloadvim-polyglot-8f9e5ac70b3492b1385ed01d832f51388d643275.tar.gz
vim-polyglot-8f9e5ac70b3492b1385ed01d832f51388d643275.zip
Add extensions to the readme
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build20
1 files changed, 19 insertions, 1 deletions
diff --git a/scripts/build b/scripts/build
index d117c3bd..1d5620b5 100755
--- a/scripts/build
+++ b/scripts/build
@@ -531,11 +531,27 @@ def extract(packages)
end
+ names = nil
langs = package["filetypes"].map { |f| f["linguist"] }.compact
if langs.size > 0
- output[-1] << " (#{print_and(langs)} syntax highlighting)"
+ names = print_and(langs)
end
+ files = nil
+ extensions = package["filetypes"].flat_map { |f| f["extensions"].reject { |e| e.match?(/_/) } }.compact
+ if extensions.size > 0
+ files = print_and(extensions)
+ end
+
+ if names && files
+ output[-1] << " (#{names} syntax highlighting for #{files} files)"
+ elsif names
+ output[-1] << " (#{names} syntax highlighting)"
+ elsif files
+ output[-1] << " (Syntax highlighting for #{files} files)"
+ end
+
+
progress
end
@@ -557,6 +573,8 @@ end
def print_and(list)
if list.size == 1
list[0]
+ elsif list.size > 10
+ list[0...5].join(", ") + " and #{list.size - 5} more"
else
list[0..-2].join(", ") + " and " + list[-1]
end