Skip to content

Commit

Permalink
final script
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza787b committed Aug 25, 2024
1 parent 243b209 commit ec6227e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions setup/setup_px4_sitl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ DEFAULT_CONFIG_FILE="$HOME/.px4sitl_config"
DEFAULT_FALLBACK_IP="127.0.0.1"
SCRIPT_NAME="px4xplane_script.sh"
PLATFORM_CHOICES=("xplane_ehang184" "xplane_alia250" "xplane_cessna172" "xplane_tb2")
REPAIR_MODE_FLAG="--repair"

# === Repair Mode (Configurable) ===
REPAIR_MODE=false # Default behavior, set to true if you always want full repair mode

# === Flags and Arguments ===
REPAIR_MODE=false # Default: Skip repair if not explicitly asked
REPAIR_MODE_FLAG="--repair"
if [[ "$1" == "$REPAIR_MODE_FLAG" ]]; then
REPAIR_MODE=true
REPAIR_MODE=true # Override repair mode from command line
shift
fi

Expand Down Expand Up @@ -74,7 +76,7 @@ fi
if [ -d "$CLONE_PATH" ] && [ -f "$CONFIG_FILE" ] && [ "$REPAIR_MODE" = false ]; then
highlight "Detected existing configuration. Skipping setup and proceeding to build..."
else
# === Full Repair Mode (If Flag is Set) ===
# === Full Repair Mode (If Flag is Set or Configured) ===
if [ "$REPAIR_MODE" = true ]; then
highlight "Repair mode enabled. Running full setup and pulling the latest code..."
fi
Expand Down Expand Up @@ -202,6 +204,7 @@ select PLATFORM in "${PLATFORM_CHOICES[@]}"; do
highlight "You have selected $PLATFORM. Building..."
LAST_PLATFORM="$PLATFORM"
echo "LAST_PLATFORM=$LAST_PLATFORM" >> "$CONFIG_FILE"
cd "$CLONE_PATH" || exit # Ensure we are in the repository directory before building
make px4_sitl_default "$PLATFORM"
break
else
Expand Down

0 comments on commit ec6227e

Please sign in to comment.