mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 21:14:01 +08:00
setup.sh: work in non interactive mode (#33162)
* work without terminal
* failure message
* no if
old-commit-hash: 3e66827a85
This commit is contained in:
@@ -73,9 +73,14 @@ function check_dir() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# already a "valid" openpilot clone, skip cloning again
|
||||
if [[ ! -z "$(ls -A $OPENPILOT_ROOT)" ]]; then
|
||||
SKIP_GIT_CLONE=1
|
||||
fi
|
||||
|
||||
# by default, don't try installing in already existing directory
|
||||
if [[ -z $INTERACTIVE ]]; then
|
||||
return 1
|
||||
return 0
|
||||
fi
|
||||
|
||||
read -p " Would you like to attempt installation anyway? [Y/n] " -n 1 -r
|
||||
@@ -84,11 +89,6 @@ function check_dir() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
# already a "valid" openpilot clone, skip cloning again
|
||||
if [[ ! -z "$(ls -A $OPENPILOT_ROOT)" ]]; then
|
||||
SKIP_GIT_CLONE=1
|
||||
fi
|
||||
|
||||
return 0
|
||||
fi
|
||||
|
||||
@@ -123,10 +123,10 @@ function git_clone() {
|
||||
function install_with_op() {
|
||||
cd $OPENPILOT_ROOT
|
||||
$OPENPILOT_ROOT/tools/op.sh install
|
||||
$OPENPILOT_ROOT/tools/op.sh setup
|
||||
$OPENPILOT_ROOT/tools/op.sh setup || (echo -e "\n[${RED}✗${NC}] failed to install openpilot!" && return 1)
|
||||
|
||||
echo -e "\n----------------------------------------------------------------------"
|
||||
echo -e "openpilot was successfully installed into ${BOLD}$OPENPILOT_ROOT${NC}"
|
||||
echo -e "[${GREEN}✔${NC}] openpilot was successfully installed into ${BOLD}$OPENPILOT_ROOT${NC}"
|
||||
echo -e "Checkout the docs at https://docs.comma.ai"
|
||||
echo -e "Checkout how to contribute at https://github.com/commaai/openpilot/blob/master/docs/CONTRIBUTING.md"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user