#!/bin/sh

# This is a small shell wrapper which adds LitREPL plugin from the current
# repository to the VIM's runtime path.

if ! test -f "$LITREPL_ROOT/vim/plugin/litrepl.vim" ; then
  echo "'litrepl.vim' is not under the LITREPL_ROOT. Did you source 'env.sh'?" >&2
  exit 1
fi
exec vim -c "
if exists('g:litrepl_bin')
  unlet g:litrepl_bin
endif
if exists('g:litrepl_loaded')
  unlet g:litrepl_loaded
endif
let &runtimepath = '$LITREPL_ROOT/vim,'.&runtimepath
runtime plugin/litrepl.vim
" "$@"
