Skip to content

Commit 6f8b78c

Browse files
committed
fix(setup.sh): installation issues
- run ros apt key download with `sudo` to access `/usr/share` - add python bins in `~/.local/bin` to `PATH` - add `BRANCH` argument, of `bitbots_main` branch to checkout
1 parent d5e6b92 commit 6f8b78c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

scripts/setup.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22
set -eEuo pipefail
33

44
# static/global variables
5-
ROS_DISTRO=${ROS_DISTRO:-"jazzy"}
65
DIR="$(dirname "$(readlink -f "$0")")"
6+
BRANCH="${1:-main}"
7+
ROS_DISTRO=${ROS_DISTRO:-"jazzy"}
78
COLCON_WS="${COLCON_WS:-"$HOME/colcon_ws"}"
89
REPO_URL="git@github.com:bit-bots/bitbots_main.git"
910
SHELL_CONFIG="$(cat <<EOF
1011
1112
# >>> bit-bots initialize >>>
1213
14+
# Add python pip bins to PATH
15+
export PATH="\$HOME/.local/bin:\$PATH"
16+
1317
# Ignore some deprecation warnings
1418
export PYTHONWARNINGS="ignore:::setuptools.command.install,ignore:::setuptools.command.easy_install,ignore:::pkg_resources,ignore:easy_install command is deprecated,ignore:setup.py install is deprecated"
1519
@@ -59,7 +63,7 @@ setup_ros() {
5963
if [[ ! -f /etc/apt/sources.list.d/ros2.list ]]; then
6064
echo "Adding ROS 2 repository..."
6165
sudo apt install -y curl lsb-release
62-
curl -fsSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key > /usr/share/keyrings/ros-archive-keyring.gpg
66+
sudo sh -c "curl -fsSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key > /usr/share/keyrings/ros-archive-keyring.gpg"
6367
sudo sh -c "echo 'deb [signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main' > /etc/apt/sources.list.d/ros2.list"
6468
fi
6569

@@ -89,7 +93,7 @@ setup_repo() {
8993
else
9094
if [[ ! -d "$PWD/bitbots_main" ]]; then
9195
git clone "$REPO_URL"
92-
git switch feature/jazzy-ubuntu2404-devcontainer
96+
git switch "$BRANCH"
9397
fi
9498

9599
meta_dir="$(realpath "$PWD/bitbots_main")"

0 commit comments

Comments
 (0)