Sat, 30 Oct 2021 19:58:51 -0400
lsp diagnostics can chill
932 | 1 | realpath() { |
2 | local dir="$(dirname -- "$1")" | |
3 | local file="$(basename -- "$1")" | |
4 | (cd "$dir" 2>/dev/null && printf '%s/%s\n' "$(pwd -P)" "$file") | |
5 | } | |
6 | ||
915 | 7 | stubexec() { |
932 | 8 | local real_me="$(realpath "$0")" |
9 | local real_bin="$(which -a $(basename $0) | grep -v "$real_me" | head -n 1)" | |
915 | 10 | if [ -x "$real_bin" ]; then |
11 | exec $real_bin $* | |
12 | fi | |
13 | } |