From 33f610feb73ce782cf41a7d9a377541991c692b5 Mon Sep 17 00:00:00 2001 From: Dan Reif Date: Tue, 5 Jun 2018 16:41:17 -0700 Subject: Changes to `build` for `README.md` updates * Make the number of packages in the project easier to find. * Replace `ed` with `awk` in `update_readme()`, the latter being (_arguably_!) more readable/less fragile. --- README.md | 4 +++- build | 30 ++++++++++++++++++++---------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 7db8c0d3..e620b91f 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A collection of language packs for Vim. > One to rule them all, one to find them, one to bring them all and in the darkness bind them. - It **won't affect your startup time**, as scripts are loaded only on demand\*. -- It **installs and updates 100+ times faster** than 100+ packages it consists of. +- It **installs and updates 100+ times faster** than the 114 packages it consists of. - Solid syntax and indentation support (other features skipped). Only the best language packs. - All unnecessary files are ignored (like enormous documentation from php support). - No support for esoteric languages, only most popular ones (modern too, like `slim`). @@ -42,6 +42,7 @@ If you need full functionality of any plugin, please use it directly with your p ## Language packs + - [ansible](https://github.com/pearofducks/ansible-vim) (syntax, indent, ftplugin) - [apiblueprint](https://github.com/sheerun/apiblueprint.vim) (syntax) - [applescript](https://github.com/mityu/vim-applescript) (syntax, indent) @@ -156,6 +157,7 @@ If you need full functionality of any plugin, please use it directly with your p - [xls](https://github.com/vim-scripts/XSLT-syntax) (syntax) - [yaml](https://github.com/stephpy/vim-yaml) (syntax, ftplugin) - [yard](https://github.com/sheerun/vim-yardoc) (syntax) + ## Updating diff --git a/build b/build index 2668e0ea..381279c3 100755 --- a/build +++ b/build @@ -127,17 +127,27 @@ copy_file() { } update_readme() { - ed README.md <<- EOF -/Language packs -+2kb -/## -'b,-2c -$(echo -n "$OUTPUT" | sort) -. -w -q -EOF + local tf of + tf="$(mktemp)" + of="$(mktemp)" + sort <<<"$OUTPUT" | grep -vxE '[[:space:]]*' > "$of" + awk 'suppress == 0 { + gsub(/[^<]*/, + "'"$(awk 'END {print NR}' "$of")"'"); + print; + } + // { + suppress = 1; + while ( ( getline line < "'"$of"'" ) > 0 ) { + print line; + } + } + // { + suppress = 0; + print; + }' "README.md" >"$tf" + mv "$tf" "README.md" } PACKS=" -- cgit v1.2.3