diff --git a/scripts/build.sh b/scripts/build.sh index 5525015..0f45b09 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,3 +1,13 @@ #!/bin/bash +set -euo pipefail + +if ! command -v colcon &>/dev/null; then + echo "Error: colcon is not installed." >&2 + echo "" >&2 + echo "Install it with:" >&2 + echo " sudo apt install python3-colcon-common-extensions" >&2 + echo " # or: pip install colcon-common-extensions" >&2 + exit 1 +fi colcon build --merge-install --install-base /opt/drs/install --parallel-workers 4 --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-up-to drs_launch diff --git a/scripts/setup_repos.sh b/scripts/setup_repos.sh index 94debbd..bc0d3b4 100755 --- a/scripts/setup_repos.sh +++ b/scripts/setup_repos.sh @@ -5,6 +5,28 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)" REPOS_FILE="${REPO_ROOT}/drs.repos" +missing_deps=() + +if ! command -v git &>/dev/null; then + missing_deps+=("git") +fi + +if ! command -v vcs &>/dev/null; then + missing_deps+=("vcs (vcstool)") +fi + +if [ ${#missing_deps[@]} -gt 0 ]; then + echo "Error: The following required commands are not installed:" >&2 + for dep in "${missing_deps[@]}"; do + echo " - ${dep}" >&2 + done + echo "" >&2 + echo "Install them with:" >&2 + echo " sudo apt install git python3-vcstool" >&2 + echo " # or: pip install vcstool" >&2 + exit 1 +fi + GITHUB_TOKEN="" RECURSIVE=false