Tools: install-preresq-ubuntu: add check for DO_AP_STM_ENV before adding to path

This prevent to have /opt//bin on PATH if we don't want STM toolchain
This commit is contained in:
Pierre Kancir 2021-06-28 15:59:53 +02:00 committed by Peter Barker
parent 5468869eba
commit 712d812f4e

View File

@ -256,6 +256,8 @@ heading "Adding ArduPilot Tools to environment"
SCRIPT_DIR=$(dirname $(realpath ${BASH_SOURCE[0]}))
ARDUPILOT_ROOT=$(realpath "$SCRIPT_DIR/../../")
if [[ $DO_AP_STM_ENV -eq 1 ]]; then
exportline="export PATH=$OPT/$ARM_ROOT/bin:\$PATH";
grep -Fxq "$exportline" ~/$SHELL_LOGIN 2>/dev/null || {
if maybe_prompt_user "Add $OPT/$ARM_ROOT/bin to your PATH [N/y]?" ; then
@ -265,6 +267,7 @@ grep -Fxq "$exportline" ~/$SHELL_LOGIN 2>/dev/null || {
echo "Skipping adding $OPT/$ARM_ROOT/bin to PATH."
fi
}
fi
exportline2="export PATH=$ARDUPILOT_ROOT/$ARDUPILOT_TOOLS:\$PATH";
grep -Fxq "$exportline2" ~/$SHELL_LOGIN 2>/dev/null || {