-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbootstrap.sh
More file actions
executable file
·43 lines (34 loc) · 1.42 KB
/
Copy pathbootstrap.sh
File metadata and controls
executable file
·43 lines (34 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env bash
# First-time native Ubuntu 24 setup.
# Ensures git is installed, clones the repo, then runs setup.sh.
# If you already have the repo, just run setup.sh directly.
# See: https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/
set -Eeuo pipefail
readonly RED_BOLD='\033[1;31m'
readonly GREY_BOLD='\033[1;30m'
readonly NC='\033[0m'
if ! grep -q '^VERSION_CODENAME=noble' /etc/os-release 2>/dev/null; then
echo -e "${RED_BOLD}This script requires Ubuntu 24.04.${NC}"
exit 1
fi
echo -e "${GREY_BOLD}Ensuring SSH keys are set up ...${NC}"
if [ ! -f ~/.ssh/id_ed25519 ] && [ ! -f ~/.ssh/id_rsa ]; then
echo -e "${RED_BOLD}Please see: https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent${NC}"
exit 1
fi
# git via PPA
if ! grep -rq "^deb .*git-core/ppa" /etc/apt/sources.list /etc/apt/sources.list.d/ 2>/dev/null; then
echo -e "${GREY_BOLD}Adding PPA: git-core/ppa${NC}"
sudo apt-add-repository ppa:git-core/ppa -y
sudo apt update
fi
sudo apt install -y git git-lfs
readonly CATKIN_PATH=~/ros2_ws
readonly MROVER_PATH=${CATKIN_PATH}/src/mrover
if [ ! -d "${MROVER_PATH}" ]; then
echo -e "${GREY_BOLD}Creating ROS workspace ...${NC}"
mkdir -p "${CATKIN_PATH}"/src
git clone git@github.com:umrover/mrover-ros2 "${CATKIN_PATH}"/src/mrover
cd "${CATKIN_PATH}"/src/mrover
fi
exec "${MROVER_PATH}/setup.sh"