提交 b3a4fdd1 编写于 作者: S storypku 提交者: Chang Songhong

Scripts: improved "apollo.sh clean".

Added "bash apollo.sh clean --help" for usage
上级 18d48baf
...@@ -124,7 +124,7 @@ function _usage() { ...@@ -124,7 +124,7 @@ function _usage() {
${BLUE}doc${NO_COLOR}: generate doxygen document ${BLUE}doc${NO_COLOR}: generate doxygen document
${BLUE}clean${NO_COLOR}: cleanup bazel output and log/coredump files ${BLUE}clean${NO_COLOR}: cleanup bazel output and log/coredump files
${BLUE}format${NO_COLOR}: format C++/Python/Bazel/Shell files ${BLUE}format${NO_COLOR}: format C++/Python/Bazel/Shell files
${BLUE}usage${NO_COLOR}: show this message ${BLUE}usage${NO_COLOR}: show this message and exit
" "
} }
...@@ -199,7 +199,7 @@ function main() { ...@@ -199,7 +199,7 @@ function main() {
env ${APOLLO_ENV} bash "${APOLLO_ROOT_DIR}/scripts/apollo_lint.sh" cpp env ${APOLLO_ENV} bash "${APOLLO_ROOT_DIR}/scripts/apollo_lint.sh" cpp
;; ;;
clean) clean)
env ${APOLLO_ENV} bash "${APOLLO_ROOT_DIR}/scripts/apollo_clean.sh" "-a" env ${APOLLO_ENV} bash "${APOLLO_ROOT_DIR}/scripts/apollo_clean.sh" "$@"
;; ;;
doc) doc)
env ${APOLLO_ENV} bash "${APOLLO_ROOT_DIR}/scripts/apollo_docs.sh" "$@" env ${APOLLO_ENV} bash "${APOLLO_ROOT_DIR}/scripts/apollo_docs.sh" "$@"
......
...@@ -38,9 +38,9 @@ function _clean_bazel_cache() { ...@@ -38,9 +38,9 @@ function _clean_bazel_cache() {
# Remove bazel cache in associated directories # Remove bazel cache in associated directories
if [ -d /apollo-simulator ]; then if [ -d /apollo-simulator ]; then
pushd /apollo-simulator > /dev/null pushd /apollo-simulator >/dev/null
bazel clean ${opt} bazel clean ${opt}
popd > /dev/null popd >/dev/null
fi fi
} }
...@@ -75,11 +75,15 @@ function _print_usage() { ...@@ -75,11 +75,15 @@ function _print_usage() {
echo "${TAB}--log Remove log files" echo "${TAB}--log Remove log files"
echo "${TAB}-a, --all Equivalent to \"--bazel --core --log\"" echo "${TAB}-a, --all Equivalent to \"--bazel --core --log\""
echo "${TAB}--expunge Run \"bazel clean --expunge\"" echo "${TAB}--expunge Run \"bazel clean --expunge\""
echo "${TAB}-h, --help Show this message and exit"
echo "${TAB}-h, --help Show this message"
} }
function parse_arguments() { function parse_arguments() {
if [[ $# -eq 0 ]]; then
_print_usage
exit 1
fi
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
local opt="$1" local opt="$1"
shift shift
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册