Skip to content

Commit

Permalink
clone first
Browse files Browse the repository at this point in the history
  • Loading branch information
alireza787b committed Aug 25, 2024
1 parent 114a37c commit 4bfebb7
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions setup/setup_px4_sitl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,7 @@ if [ ! -d "$CLONE_PATH" ]; then
mkdir -p "$CLONE_PATH"
fi

# === Ensure the Script is in the Target Folder ===
TARGET_SCRIPT_PATH="$CLONE_PATH/$SCRIPT_NAME"
if [ "$(realpath "$0")" != "$(realpath "$TARGET_SCRIPT_PATH")" ]; then
echo "Copying script to $TARGET_SCRIPT_PATH..."
cp "$0" "$TARGET_SCRIPT_PATH"
fi


# === Introductory Information ===
echo "----------------------------------------------------------"
Expand Down Expand Up @@ -83,6 +78,13 @@ else
echo "Repository already cloned at $CLONE_PATH."
fi

# === Ensure the Script is in the Target Folder ===
TARGET_SCRIPT_PATH="$CLONE_PATH/$SCRIPT_NAME"
if [ "$(realpath "$0")" != "$(realpath "$TARGET_SCRIPT_PATH")" ]; then
echo "Copying script to $TARGET_SCRIPT_PATH..."
cp "$0" "$TARGET_SCRIPT_PATH"
fi

cd "$CLONE_PATH" || exit
git checkout "$BRANCH_NAME"

Expand Down

0 comments on commit 4bfebb7

Please sign in to comment.