-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.bash
41 lines (34 loc) · 1000 Bytes
/
install.bash
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
export EMC_DIR=~/.emc
export EMC_ENV_DIR=$EMC_DIR/env
if ! dpkg -s curl &> /dev/null
then
echo "Going to install curl"
sudo apt-get install -y -q curl
fi
if ! dpkg -s git &> /dev/null
then
echo "Going to install git"
sudo apt-get install -y -q git
fi
if ! dpkg -s python-is-python3 &> /dev/null
then
echo "Going to install python-is-python3"
sudo apt-get install -y -q python-is-python3
fi
# Install / update the installer / updater
if [[ ! -d $EMC_ENV_DIR ]] && [[ -z "$CI" ]]
then
git clone https://github.com/tue-robotics/emc-env $EMC_ENV_DIR
elif [[ -n "$CI" ]]
then
mkdir -p $EMC_DIR
cp -r . $EMC_ENV_DIR
else
git -C $EMC_ENV_DIR pull
fi
# Source the updated environment
source $EMC_ENV_DIR/setup.bash
# Add sourcing the environment to ~/.bashrc (if not already there)
! grep 'Source the EMC environment' ~/.bashrc -q && echo -e "\n# Source the EMC environment\nsource $EMC_ENV_DIR/setup.bash" >> ~/.bashrc
# Run the installer / updater
emc-update