summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2015-07-18 22:34:26 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2015-07-18 22:34:26 +0200
commit548653cafeaa948161ad9ac8184deca0bff95537 (patch)
treea51a66b1473c16a8ba245739450c1178c3ebc33c
parentee6b1ea1574dbc6d651f7a63b26a1f9b95998249 (diff)
downloadvim-polyglot-548653cafeaa948161ad9ac8184deca0bff95537.tar.gz
vim-polyglot-548653cafeaa948161ad9ac8184deca0bff95537.zip
Automatically update README upon build
-rw-r--r--README.md1
-rwxr-xr-xbuild28
2 files changed, 27 insertions, 2 deletions
diff --git a/README.md b/README.md
index 036d2f93..cc84c834 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,7 @@ Optionally download one of the [releases](https://github.com/sheerun/vim-polyglo
- [protobuf](https://github.com/uarun/vim-protobuf) (syntax, ftdetect)
- [python](https://github.com/mitsuhiko/vim-python-combined) (syntax, indent)
- [r-lang](https://github.com/vim-scripts/R.vim) (syntax, ftplugin)
+- [ragel](https://github.com/jneen/ragel.vim) (syntax)
- [rspec](https://github.com/sheerun/rspec.vim) (syntax, ftdetect)
- [ruby](https://github.com/vim-ruby/vim-ruby) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
- [rust](https://github.com/wting/rust.vim) (syntax, indent, compiler, autoload, ftplugin, ftdetect)
diff --git a/build b/build
index 620ce8f3..bd3980b4 100755
--- a/build
+++ b/build
@@ -5,6 +5,13 @@ set -E
DIRS="syntax indent compiler autoload ftplugin ftdetect after/syntax after/indent after/ftplugin after/ftdetect"
DIRS_BASIC="syntax indent ftdetect after/syntax after/indent after/ftdetect"
+OUTPUT=""
+
+output() {
+ OUTPUT="$OUTPUT$1"
+ printf -- "$1"
+}
+
download() {
for pack in $1; do
path="$(printf "$pack" | cut -d ':' -f 2)"
@@ -24,7 +31,7 @@ extract() {
dir="tmp/$(printf "$path" | cut -d '/' -f 2)"
directories="DIRS$(printf "$pack" | cut -d ':' -f 3)"
subtree="$(printf "$pack" | cut -d ':' -f 4)"
- printf -- "- [$name](https://github.com/$path) ("
+ output "- [$name](https://github.com/$path) ("
subdirs=""
for subdir in ${!directories}; do
@@ -39,7 +46,7 @@ extract() {
done
- printf "${subdirs##, })\n"
+ output "${subdirs##, })\n"
done
for pack in $1; do
@@ -69,6 +76,22 @@ concat_ftdetect() {
mv tmp/polyglot.vim ftdetect/
}
+update_readme() {
+ OLD_README="$(cat README.md)"
+
+ ed README.md <<- EOF
+/Language packs
++2kb
+/##
+'b,-2c
+$(printf -- "$OUTPUT")
+.
+w
+q
+EOF
+
+}
+
PACKS="
arduino:sudar/vim-arduino-syntax
blade:xsbeats/vim-blade
@@ -144,5 +167,6 @@ printf "Downloading packs..."
download "$PACKS"
extract "$PACKS"
concat_ftdetect
+update_readme
rm -rf tmp