mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-08 17:08:28 -04:00
autotest: cope with symlinks in vehicle path
This commit is contained in:
parent
b14e0b65b6
commit
dd04326693
@ -188,7 +188,12 @@ SIMOUT_PORT="127.0.0.1:"$((5501+10*$INSTANCE))
|
||||
FG_PORT="127.0.0.1:"$((5503+10*$INSTANCE))
|
||||
|
||||
[ -z "$VEHICLE" ] && {
|
||||
VEHICLE=$(basename $PWD)
|
||||
CDIR="$PWD"
|
||||
rpath=$(which realpath)
|
||||
[ -n "rpath" ] && {
|
||||
CDIR=$(realpath $CDIR)
|
||||
}
|
||||
VEHICLE=$(basename $CDIR)
|
||||
}
|
||||
|
||||
[ -z "$FRAME" -a "$VEHICLE" = "APMrover2" ] && {
|
||||
@ -287,8 +292,12 @@ autotest="../Tools/autotest"
|
||||
# the location of the sim_vehicle.sh script to find the path
|
||||
autotest=$(dirname $(readlink -e $0))
|
||||
}
|
||||
pushd $autotest/../../$VEHICLE || {
|
||||
echo "Failed to change to vehicle directory for $VEHICLE"
|
||||
VEHICLEDIR="$autotest/../../$VEHICLE"
|
||||
[ -d "$VEHICLEDIR" ] || {
|
||||
VEHICLEDIR=$(dirname $(readlink -e $VEHICLEDIR))
|
||||
}
|
||||
pushd $VEHICLEDIR || {
|
||||
echo "Failed to change to vehicle directory for $VEHICLEDIR"
|
||||
usage
|
||||
exit 1
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user