summaryrefslogtreecommitdiff
path: root/utils/bin
diff options
context:
space:
mode:
authorkylo252 <[email protected]>2021-10-09 22:17:30 +0200
committerkylo252 <[email protected]>2021-10-09 22:17:30 +0200
commitcaf62bcfed4fc6cfed26164e39d22a568d21f9d0 (patch)
tree47f7ddcbe7ef10b6cffd8398dbfc215d94fc2fae /utils/bin
parent4126e5765d69840660fab2a05bbc664ad0117b95 (diff)
parent82b7a35858479223c1e34bea2f64451ecf1e5f66 (diff)
Merge remote-tracking branch 'origin/rolling'
Diffstat (limited to 'utils/bin')
-rw-r--r--utils/bin/lvim2
-rw-r--r--utils/bin/lvim.ps19
-rw-r--r--utils/bin/test_runner.sh20
3 files changed, 30 insertions, 1 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/lvim.ps1 b/utils/bin/lvim.ps1
new file mode 100644
index 00000000..e220e8ec
--- /dev/null
+++ b/utils/bin/lvim.ps1
@@ -0,0 +1,9 @@
+$env:XDG_DATA_HOME = ($env:XDG_DATA_HOME, "$env:APPDATA", 1 -ne $null)[0]
+$env:XDG_CONFIG_HOME = ($env:XDG_CONFIG_HOME, "$LOCALAPPDATA", 1 -ne $null)[0]
+$env:XDG_CACHE_HOME = ($env:XDG_CACHE_HOME, "$TEMP", 1 -ne $null)[0]
+
+$env:LUNARVIM_RUNTIME_DIR = ($env:LUNARVIM_RUNTIME_DIR, "$env:XDG_DATA_HOME\lunarvim", 1 -ne $null)[0]
+$env:LUNARVIM_CONFIG_DIR = ($env:LUNARVIM_CONFIG_DIR, "$env:XDG_CONFIG_HOME\lvim", 1 -ne $null)[0]
+$env:LUNARVIM_CACHE_DIR = ($env:LUNARVIM_CACHE_DIR, "$env:XDG_CACHE_HOME\lvim", 1 -ne $null)[0]
+
+nvim -u "$env:LUNARVIM_RUNTIME_DIR\lvim\init.lua"
diff --git a/utils/bin/test_runner.sh b/utils/bin/test_runner.sh
new file mode 100644
index 00000000..ee138345
--- /dev/null
+++ b/utils/bin/test_runner.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+set -e
+
+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/tests/minimal_init.lua" --cmd "set runtimepath+=$LUNARVIM_RUNTIME_DIR/lvim" "$@"
+}
+
+if [ -n "$1" ]; then
+ lvim --headless -c "lua require('plenary.busted').run('$1')"
+else
+ lvim --headless -c "PlenaryBustedDirectory tests/ { minimal_init = './tests/minimal_init.lua' }"
+fi