diff options
| author | dacctal <dacctal@symlinx.net> | 2026-04-27 05:30:46 +0000 |
|---|---|---|
| committer | dacctal <dacctal@symlinx.net> | 2026-04-27 05:30:46 +0000 |
| commit | d33d907f53c50d323eca75c4bfc02ab5b989b30a (patch) | |
| tree | 6888a2074338a723f0fde99b03b09fbab91a265f /.config/vis/plugins/vis-lspc/tools | |
| parent | 89505535c652cd6f31a15df73293c6e90eaa852f (diff) | |
Diffstat (limited to '.config/vis/plugins/vis-lspc/tools')
| -rwxr-xr-x | .config/vis/plugins/vis-lspc/tools/check-format | 8 | ||||
| -rwxr-xr-x | .config/vis/plugins/vis-lspc/tools/find-upwards | 26 |
2 files changed, 34 insertions, 0 deletions
diff --git a/.config/vis/plugins/vis-lspc/tools/check-format b/.config/vis/plugins/vis-lspc/tools/check-format new file mode 100755 index 0000000..392d023 --- /dev/null +++ b/.config/vis/plugins/vis-lspc/tools/check-format @@ -0,0 +1,8 @@ +#!/bin/sh + +LUA_FILE=$1 +lua-format "${LUA_FILE}" > "${LUA_FILE}.fmt" +diff "${LUA_FILE}" "${LUA_FILE}.fmt" +RET=$? +rm "${LUA_FILE}.fmt" +exit ${RET} diff --git a/.config/vis/plugins/vis-lspc/tools/find-upwards b/.config/vis/plugins/vis-lspc/tools/find-upwards new file mode 100755 index 0000000..85dc722 --- /dev/null +++ b/.config/vis/plugins/vis-lspc/tools/find-upwards @@ -0,0 +1,26 @@ +#!/bin/sh + +set -eu + +if [ ! "${1:-}" ]; then + exit 1 +fi + +BASEDIR="$(dirname "$1")" + +while read -r glob; do + cd "$BASEDIR" + + while [ "$PWD" != "/" ]; do + set -- "$glob" + + if [ -e "$1" ]; then + echo "$PWD" + exit 0 + fi + + cd .. + done +done + +exit 1 |
