提交 4ed894d2 编写于 作者: S storypku

Scripts: don't install clang-format by default in clang-format.sh

上级 568bddd3
......@@ -23,7 +23,7 @@
set -euo pipefail
TOP_DIR="$( cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)"
. "${TOP_DIR}/scripts/apollo.bashrc"
source "${TOP_DIR}/scripts/apollo.bashrc"
TARGET=$1
if [[ -z "${TARGET}" ]]; then
......@@ -35,10 +35,11 @@ fi
CLANG_FORMAT_CMD="$(command -v clang-format)"
if [[ -z "${CLANG_FORMAT_CMD}" ]]; then
echo "Installing clang-format..."
sudo apt-get -y update && \
sudo apt-get -y install clang-format
CLANG_FORMAT_CMD="$(command -v clang-format)"
error "Oops, clang-format missing..."
error "Please make sure clang-format is installed and check your PATH" \
"settings. For Debian/Ubuntu, you can run the following command:"
error " sudo apt-get -y update && sudo apt-get -y install clang-format"
exit 1
fi
function clang_format_run() {
......@@ -51,8 +52,7 @@ if [ -f "${TARGET}" ]; then
clang_format_run "${TARGET}"
info "Done formatting ${TARGET}"
else
warning "Do nothing. ${TARGET} " \
"is not c/c++/cuda header/source file."
warning "Do nothing. ${TARGET} is not a c/c++/cuda header/source file."
fi
else
srcs="$(find_c_cpp_srcs ${TARGET})"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册