summaryrefslogtreecommitdiff
path: root/utils/bin
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-09-13 11:10:07 +0200
committerGitHub <[email protected]>2021-09-13 11:10:07 +0200
commitfcb764cd638ddffbe96228c6b3b1b8e0d40dbb23 (patch)
treebb24c5a66ac390fff0d8f86bd1c07bd47f43b371 /utils/bin
parente93c6abab7d9fb3885cb53310d840204ff6ffc01 (diff)
refactor(ci): better path handling (#1531)
Diffstat (limited to 'utils/bin')
-rw-r--r--utils/bin/lvim2
-rw-r--r--utils/bin/test_runner.sh17
2 files changed, 15 insertions, 4 deletions
diff --git a/utils/bin/lvim b/utils/bin/lvim
index 2303be3c..e4cd9c75 100644
--- a/utils/bin/lvim
+++ b/utils/bin/lvim
@@ -1,6 +1,6 @@
#!/bin/sh
export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-$HOME/.local/share/lunarvim}"
-export LUNARVIM_CONFIG_DIR="${LUNARVIM_RUNTIME_DIR:-$HOME/.config/lvim}"
+export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-$HOME/.config/lvim}"
exec nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" "$@"
diff --git a/utils/bin/test_runner.sh b/utils/bin/test_runner.sh
index 5b46e578..0dabd77f 100644
--- a/utils/bin/test_runner.sh
+++ b/utils/bin/test_runner.sh
@@ -1,9 +1,20 @@
#!/usr/bin/env bash
set -e
-# TODO: allow running with a minimal_init.lua
+export LUNARVIM_CONFIG_DIR="${LUNARVIM_CONFIG_DIR:-"$HOME/.config/lvim"}"
+export LUNARVIM_RUNTIME_DIR="${LUNARVIM_RUNTIME_DIR:-"$HOME/.local/share/lunarvim"}"
+
+export LVIM_TEST_ENV=true
+
+rm -f "$LUNARVIM_CONFIG_DIR/plugin/packer_compiled.lua"
+
+lvim() {
+ # TODO: allow running with a minimal_init.lua
+ nvim -u "$LUNARVIM_RUNTIME_DIR/lvim/init.lua" --cmd "set runtimepath+=$LUNARVIM_RUNTIME_DIR/lvim" "$@"
+}
+
if [ -n "$1" ]; then
- nvim --headless -u ./init.lua -c "lua require('plenary.busted').run('$1')"
+ lvim --headless -c "lua require('plenary.busted').run('$1')"
else
- nvim --headless -u ./init.lua -c "PlenaryBustedDirectory tests/ { minimal_init = './init.lua' }"
+ lvim --headless -c "PlenaryBustedDirectory tests/ { minimal_init = './init.lua' }"
fi