Skip to content

Instantly share code, notes, and snippets.

@nevalsar
Created November 5, 2014 12:54
Show Gist options
  • Save nevalsar/743ecf7bf9ec9b0e183d to your computer and use it in GitHub Desktop.
Save nevalsar/743ecf7bf9ec9b0e183d to your computer and use it in GitHub Desktop.
Installer bash script for MORSE
#!/bin/bash
#=======================================================================
# Author : Nevin Valsaraj <nevin[dot]valsaraj32[at]gmail[dot]com>
# Distributed under the MIT License.
# (See full license at http://opensource.org/licenses/MIT)
#=======================================================================
#In short, I can't be held accountable if you wreck your computer.
echo -e "\nAlright, let's begin."
read -p "Is this the directory you cloned morse? [y/n]" -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo -e "\nStarting dangerous stuff. You should start praying now."
else
echo -e "\nPlease clone morse into the same directory as this script before continuing."
echo -e "Link : https://github.com/morse-simulator/morse.git"
echo -e "Aborting MORSE install."
exit 1
fi
echo -e "\nMoving repo to /opt/"
sudo mv morse /opt/
cd /opt/morse
echo -e "\nChecking out latest stable branch of MORSE 1.2 :"
git checkout -b 1.2_STABLE -t origin/1.2_STABLE
echo -e "\nMaking new directory to build from source :"
mkdir build && cd build
echo -e "\nRunning cmake with required flags :"
cmake -DBUILD_TESTING=ON -DBUILD_ROS_SUPPORT=ON -DCMAKE_BUILD_TYPE=Release -DPYMORSE_SUPPORT=ON -DCMAKE_INSTALL_PREFIX=/usr/local ..
echo -e "\nRunning make install :"
sudo make install
echo -e "\nAdding MORSE environment variables to .bashrc"
echo -e "\n######### MORSE SETUP ##########" >> ~/.bashrc
echo "export MORSE_ROOT=/usr/local" >> ~/.bashrc
echo "export PYTHONPATH=$MORSE_ROOT/lib/python3/dist-packages:$PYTHONPATH" >> ~/.bashrc
echo -e "\n" >> ~/.bashrc
echo -e "\nSourcing .bashrc"
source ~/.bashrc
echo -e "\nStarting MORSE's self check :"
morse check
echo -e "\nAll done and dusted. \nExiting."
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment