op.sh: fallback to script's own location for openpilot root (#37326)

op: fallback to script's own location for openpilot root
This commit is contained in:
Andi Radulescu
2026-02-27 07:24:51 +02:00
committed by GitHub
parent 0977a91d65
commit 286c4f8403
+2 -1
View File
@@ -77,7 +77,8 @@ function op_get_openpilot_dir() {
done
# Fallback to hardcoded directories if not found
for dir in "$HOME/openpilot" "/data/openpilot"; do
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
for dir in "${SCRIPT_DIR%/tools}" "$HOME/openpilot" "/data/openpilot"; do
if [[ -f "$dir/launch_openpilot.sh" ]]; then
OPENPILOT_ROOT="$dir"
return 0