2017-11-24 08:59:41 -05:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Run a "bare" Vim with just vim-go and ignoring ~/.vim
|
|
|
|
#
|
|
|
|
|
|
|
|
set -euC
|
|
|
|
vimgodir=$(cd -P "$(dirname "$0")/.." > /dev/null && pwd)
|
|
|
|
cd "$vimgodir"
|
|
|
|
|
2017-12-13 09:05:24 -05:00
|
|
|
coverage=0
|
|
|
|
while getopts "c" option; do
|
|
|
|
case "$option" in
|
|
|
|
c) coverage=1; ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
shift $((OPTIND - 1))
|
|
|
|
|
2017-11-24 08:59:41 -05:00
|
|
|
if [ -z "${1:-}" ]; then
|
|
|
|
echo "unknown version: '${1:-}'"
|
|
|
|
echo "First argument must be 'vim-7.4', 'vim-8.0', or 'nvim'."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
dir="/tmp/vim-go-test/$1-install"
|
|
|
|
export GOPATH=$dir
|
2019-05-17 10:09:13 -04:00
|
|
|
export GO111MODULE=auto
|
2017-11-24 08:59:41 -05:00
|
|
|
export PATH=${GOPATH}/bin:$PATH
|
|
|
|
shift
|
|
|
|
|
|
|
|
if [ ! -f "$dir/bin/vim" ]; then
|
|
|
|
echo "$dir/bin/vim doesn't exist; did you install it with the install-vim script?"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-12-13 09:05:24 -05:00
|
|
|
if [ $coverage -eq 1 ]; then
|
|
|
|
covimerage -q run --report-file /tmp/vim-go-test/cov-profile.txt --append \
|
|
|
|
$dir/bin/vim --noplugin -u NONE -N \
|
2018-06-14 06:31:12 -04:00
|
|
|
+"set shm+=WAFI rtp^=$vimgodir packpath=$dir/share/vim/vimgo" \
|
2017-12-13 09:05:24 -05:00
|
|
|
+'filetype plugin indent on' \
|
|
|
|
+'packloadall!' \
|
|
|
|
"$@"
|
|
|
|
else
|
|
|
|
$dir/bin/vim --noplugin -u NONE -N \
|
2018-06-14 06:31:12 -04:00
|
|
|
+"set shm+=WAFI rtp^=$vimgodir packpath=$dir/share/vim/vimgo" \
|
2017-12-13 09:05:24 -05:00
|
|
|
+'filetype plugin indent on' \
|
|
|
|
+'packloadall!' \
|
|
|
|
"$@"
|
|
|
|
fi
|
2017-11-24 08:59:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
# vim:ts=2:sts=2:sw=2:et
|