test/run: shellcheck fixes (#562)
This commit is contained in:
parent
f916aabfbe
commit
0b1343b582
1 changed files with 11 additions and 7 deletions
18
test/run
18
test/run
|
@ -1,6 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
cd $(dirname "${BASH_SOURCE[0]}")
|
# Privileged mode, ignores $CDPATH etc.
|
||||||
|
set -p
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
cd "$(dirname "${BASH_SOURCE[0]}")"
|
||||||
|
|
||||||
export BASE="$PWD"
|
export BASE="$PWD"
|
||||||
export PLUG_SRC="$PWD/../plug.vim"
|
export PLUG_SRC="$PWD/../plug.vim"
|
||||||
|
@ -16,8 +20,8 @@ set shell=/bin/bash
|
||||||
VIMRC
|
VIMRC
|
||||||
|
|
||||||
clone() {
|
clone() {
|
||||||
if [ ! -d $2 ]; then
|
if [ ! -d "$2" ]; then
|
||||||
git clone $1 $2
|
git clone "$1" "$2"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,8 +48,8 @@ make_dirs() (
|
||||||
cd "$PLUG_FIXTURES/$1"
|
cd "$PLUG_FIXTURES/$1"
|
||||||
mkdir -p autoload colors ftdetect ftplugin indent plugin syntax
|
mkdir -p autoload colors ftdetect ftplugin indent plugin syntax
|
||||||
for d in *; do
|
for d in *; do
|
||||||
[ -d $d ] || continue
|
[ -d "$d" ] || continue
|
||||||
cat > $d/xxx.vim << EOF
|
cat > "$d/xxx.vim" << EOF
|
||||||
" echom expand('<sfile>')
|
" echom expand('<sfile>')
|
||||||
let g:total_order = get(g:, 'total_order', [])
|
let g:total_order = get(g:, 'total_order', [])
|
||||||
let g:$2 = get(g:, '$2', [])
|
let g:$2 = get(g:, '$2', [])
|
||||||
|
@ -97,7 +101,7 @@ DOC
|
||||||
|
|
||||||
select_vim() {
|
select_vim() {
|
||||||
local vim=/usr/bin/vim
|
local vim=/usr/bin/vim
|
||||||
if [ -n "$DEPS" ] && [ -e "${DEPS}/bin/vim" ]; then
|
if [ -n "${DEPS:-}" ] && [ -e "${DEPS}/bin/vim" ]; then
|
||||||
vim="${DEPS}/bin/vim"
|
vim="${DEPS}/bin/vim"
|
||||||
elif [ -e "/usr/local/bin/vim" ]; then
|
elif [ -e "/usr/local/bin/vim" ]; then
|
||||||
vim=/usr/local/bin/vim
|
vim=/usr/local/bin/vim
|
||||||
|
@ -111,7 +115,7 @@ prepare
|
||||||
git --version
|
git --version
|
||||||
VIM=$(select_vim)
|
VIM=$(select_vim)
|
||||||
echo "Selected Vim: $VIM"
|
echo "Selected Vim: $VIM"
|
||||||
if [ "$1" = '!' ]; then
|
if [ "${1:-}" = '!' ]; then
|
||||||
$VIM -Nu $TEMP/mini-vimrc -c 'Vader! test.vader' > /dev/null &&
|
$VIM -Nu $TEMP/mini-vimrc -c 'Vader! test.vader' > /dev/null &&
|
||||||
prepare &&
|
prepare &&
|
||||||
$VIM -Nu $TEMP/mini-vimrc -c 'let g:plug_threads = 1 | Vader! test.vader' > /dev/null
|
$VIM -Nu $TEMP/mini-vimrc -c 'let g:plug_threads = 1 | Vader! test.vader' > /dev/null
|
||||||
|
|
Loading…
Reference in a new issue