aboutsummaryrefslogtreecommitdiff
path: root/dist/vim-plugin.sh
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-14 12:37:28 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-14 13:18:29 +1300
commit00bf3e83909df7162343224b6edc659e1d7231d5 (patch)
tree7750c33fde68fd079d0f5e9da874fd502a02c3ba /dist/vim-plugin.sh
parentMerge branch 'release/v0.17.0' into develop (diff)
downloaddotfiles-00bf3e83909df7162343224b6edc659e1d7231d5.tar.gz
dotfiles-00bf3e83909df7162343224b6edc659e1d7231d5.zip
Add Makefile targets for Vim plugin dists
This is just an experiment to see how well an automated process can make independently distributable versioned tarballs of my Vim plugins. These are not part of the default `all` or `install` target. They create distribution vim-$name-$ver.tar.gz files in vim/dist.
Diffstat (limited to 'dist/vim-plugin.sh')
-rw-r--r--dist/vim-plugin.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/dist/vim-plugin.sh b/dist/vim-plugin.sh
new file mode 100644
index 00000000..0f549be4
--- /dev/null
+++ b/dist/vim-plugin.sh
@@ -0,0 +1,18 @@
+#!/bin/sh
+ver=$(awk -Fv 'NR<2&&$0=$NF' VERSION) || exit
+mkdir -p -- vim/dist || exit
+cd -- vim/dist || exit
+for pn ; do
+ dn=vim-$(printf '%s' "$pn"|sed 's/_/-/g')-$ver
+ mkdir -p -- "$pn"
+ for fn in ../*/"$pn".txt ../*/"$pn".vim ; do
+ [ -e "$fn" ] || continue
+ sdn=$fn
+ sdn=${sdn#../}
+ sdn=${sdn%/*}
+ mkdir -p -- "$pn"/"$sdn"
+ cp -- "$fn" "$pn"/"$sdn"
+ done
+ tar c "$pn" | gzip > "$dn".tar.gz || exit
+ rm -r -- "$pn"
+done