mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
update OSX install script to fit arg options to reinstall formulas and install install sim tools
This commit is contained in:
parent
3e90c37d05
commit
02454e5ffc
@ -3,12 +3,41 @@
|
||||
# script directory
|
||||
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
|
||||
brew tap PX4/px4
|
||||
brew install px4-dev
|
||||
# Reinstall if --reinstall set
|
||||
REINSTALL_FORMULAS=""
|
||||
# Install simulation tools?
|
||||
INSTALL_SIM=""
|
||||
|
||||
# python dependencies
|
||||
# Parse arguments
|
||||
for arg in "$@"
|
||||
do
|
||||
if [[ $arg == "--reinstall" ]]; then
|
||||
REINSTALL_FORMULAS=$arg
|
||||
elif [[ $arg == "--sim-tools" ]]; then
|
||||
INSTALL_SIM=$arg
|
||||
fi
|
||||
done
|
||||
|
||||
# Install px4-dev formula
|
||||
brew tap PX4/px4
|
||||
if [ brew ls --versions px4-dev > /dev/null ]; then
|
||||
brew install px4-dev
|
||||
elif [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
|
||||
brew reinstall px4-dev
|
||||
fi
|
||||
|
||||
# Python dependencies
|
||||
sudo easy_install pip
|
||||
sudo -H pip install -r ${DIR}/requirements.txt
|
||||
sudo -H pip install --upgrade --force-reinstall pip
|
||||
sudo -H pip install -I -r ${DIR}/requirements.txt
|
||||
|
||||
# Optional, but recommended additional simulation tools:
|
||||
brew install px4-sim
|
||||
if [[ $INSTALL_SIM == "--sim-tools" ]]; then
|
||||
if [ brew ls --versions px4-sim > /dev/null ]; then
|
||||
brew install px4-sim
|
||||
elif [[ $REINSTALL_FORMULAS == "--reinstall" ]]; then
|
||||
brew reinstall px4-sim
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "All set! PX4 toolchain installed!"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user