diff options
| author | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-16 13:49:57 +0200 | 
|---|---|---|
| committer | Adam Stankiewicz <sheerun@sher.pl> | 2020-10-16 13:49:57 +0200 | 
| commit | 23d7b0931d41f1205bd284d81dc04ceb4c1615fb (patch) | |
| tree | 2fc0f955f78d73cd6fa5ba896e450f26f194b085 /scripts/build | |
| parent | 3ee6ab9d13767aacceea51e72ecf9646206b7163 (diff) | |
| download | vim-polyglot-23d7b0931d41f1205bd284d81dc04ceb4c1615fb.tar.gz vim-polyglot-23d7b0931d41f1205bd284d81dc04ceb4c1615fb.zip | |
Use language names instead of filetype names
Diffstat (limited to '')
| -rwxr-xr-x | scripts/build | 16 | 
1 files changed, 12 insertions, 4 deletions
| diff --git a/scripts/build b/scripts/build index c2e5d41a..d117c3bd 100755 --- a/scripts/build +++ b/scripts/build @@ -530,10 +530,10 @@ def extract(packages)        output << "- [#{package["name"]}](https://github.com/#{repo})"      end -    if package["filetypes"].size > 1 -      output[-1] << " (#{package["filetypes"].map { |f| f["name"] }.join(", ")[0..-2]} and #{package["filetypes"].last["name"]} filetypes)" -    elsif package["filetypes"].size > 0 -      output[-1] << " (#{package["filetypes"].first["name"]} filetype)" + +    langs = package["filetypes"].map { |f| f["linguist"] }.compact +    if langs.size > 0 +      output[-1] << " (#{print_and(langs)} syntax highlighting)"      end      progress @@ -554,6 +554,14 @@ def extract(packages)    File.write('README.md', readme)  end +def print_and(list) +  if list.size == 1 +    list[0] +  else +    list[0..-2].join(", ") + " and " + list[-1] +  end +end +  def generate_ftdetect(packages, heuristics)    FileUtils.mkdir_p('autoload/polyglot') | 
