3 ms·
Might not be an issue for your typical setup, but I suggest quoting your variable expansions in bash. Otherwise, spaces, etc., will lead to issues. It would al
by dundarious 1y ago
Might not be an issue for your typical setup, but I suggest quoting your variable expansions in bash. Otherwise, spaces, etc., will lead to issues.
It would also make sense to use path after it is defined, instead of sometimes using `$1` again.
But I'm confused by `cd`ing into `$path` and then checking paths that are prefixed by `$path`... I assume that is an error, and you won't run it like `script.sh ./work/project` and expect a path like `./work/project/work/project` or `./work/project/project` to exist. Can just `cd "$1"` and be done.
Mildly surprised the .venv/venv check isn't an elif as well.
#!/usr/bin/env bash
cd "$1"
if [ -d ./.venv ]; then
source ./.venv/bin/activate
elif [ -d ./venv ]; then
source ./venv/bin/activate
fi
exec pylsp --check-parent-process