mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
Several helper scripts assumes bash is available at /bin/bash. That breaks on systems such as NixOS, where bash is resolved from PATH instead of a fixed /bin location and causes failures like `bad interpreter` during `make format`, e.g., on my host machine: ```sh $ make format /PX4-Autopilot/Tools/astyle/check_code_style.sh: /PX4-Autopilot/Tools/astyle/fix_code_style.sh: /bin/bash: bad interpreter: No such file or directory ``` This change switches these entrypoints to `#!/usr/bin/env bash` so they locate bash properly. No functional changes intended. Signed-off-by: Onur Özkan <work@onurozkan.dev>
34 lines
934 B
Bash
Executable File
34 lines
934 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copy msgs and the message translation node into a ROS workspace directory
|
|
|
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
|
|
|
PX4_SRC_DIR="$DIR/.."
|
|
|
|
WS_DIR="$1"
|
|
if [ ! -e "${WS_DIR}" ]
|
|
then
|
|
echo "Usage: $0 <ros_ws_dir>"
|
|
exit 1
|
|
fi
|
|
WS_DIR="$WS_DIR"/src
|
|
if [ ! -e "${WS_DIR}" ]
|
|
then
|
|
echo "'src' directory not found inside ROS workspace (${WS_DIR})"
|
|
exit 1
|
|
fi
|
|
|
|
cp -ar "${PX4_SRC_DIR}"/msg/translation_node "${WS_DIR}"
|
|
cp -ar "${PX4_SRC_DIR}"/msg/px4_msgs_old "${WS_DIR}"
|
|
PX4_MSGS_DIR="${WS_DIR}"/px4_msgs
|
|
if [ ! -e "${PX4_MSGS_DIR}" ]
|
|
then
|
|
git clone https://github.com/PX4/px4_msgs.git "${PX4_MSGS_DIR}"
|
|
rm -rf "${PX4_MSGS_DIR}"/msg/*.msg
|
|
rm -rf "${PX4_MSGS_DIR}"/msg/versioned/*.msg
|
|
rm -rf "${PX4_MSGS_DIR}"/srv/*.srv
|
|
fi
|
|
cp -ar "${PX4_SRC_DIR}"/msg/*.msg "${PX4_MSGS_DIR}"/msg
|
|
cp -ar "${PX4_SRC_DIR}"/msg/versioned/*.msg "${PX4_MSGS_DIR}"/msg
|
|
cp -ar "${PX4_SRC_DIR}"/srv/*.srv "${PX4_MSGS_DIR}"/srv
|