-
Notifications
You must be signed in to change notification settings - Fork 1
/
test
executable file
·33 lines (26 loc) · 861 Bytes
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
# vim:ts=2:sw=2:sts=2
set -o errexit -o errtrace -o noclobber -o noglob -o nounset -o pipefail
cd "$(dirname "$(readlink -m "$0")")"
[[ " $* " =~ " -v " ]] ||
exec 2> >(sed -n '/^Starting Vader/,$p')
[[ ${EDITOR-} =~ ^n?vim$ ]] || export EDITOR=vim
[[ ${TMPDIR-} ]] || export TMPDIR=/tmp
[[ -d $TMPDIR/vader.vim ]] ||
git clone -b master --depth=1 --single-branch \
'https://github.com/junegunn/vader.vim' \
"$TMPDIR/vader.vim"
exec {fd1}<<'EOT'
filetype off
set rtp+=$TMPDIR/vader.vim,.
filetype plugin indent on
syntax enable
EOT
exec {fd2}<<'EOT'
Vader! t/*.vader
qall!
EOT
$EDITOR -i NONE -U NONE -u "/dev/fd/$fd1" -nNesS "/dev/fd/$fd2" || exit $(($?-1))
# ALT: [[ $? -eq 1 && $EDITOR == nvim ]]
# BUG: on ubuntu/travis exit code ok:1 err:2 for nvim/vim ~7.4.712
# BUT: for newest vim ~7.4.1797 its ok:0 err:1