ensure_bootstrap: basic argument processing

Running with --help shouldn't actually do the bootstrap.

Change-Id: Id481432cdfc23121e5b71cbe64ffb2068fea8e23
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6165754
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
changes/54/6165754/3
Mike Frysinger 5 months ago committed by LUCI CQ
parent 67acd2b92d
commit 792831e176

@ -4,16 +4,35 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This is a shell script to ensure that all of the "depot_tools" bootstrap
# programs are locally downloaded and ready for execution.
#
# Unlike "update_depot_tools", this script works with the current
# checkout, and will not update/sync the "depot_tools" repository.
#
# TODO: This duplicates logic in "update_depot_tools". Update that script to
# invoke this script instead of manually calling "cipd_bin_setup" and other
# operations.
usage() {
cat <<EOF
Usage: $0
This is a shell script to ensure that all of the "depot_tools" bootstrap
programs are locally downloaded and ready for execution.
Unlike "update_depot_tools", this script works with the current
checkout, and will not update/sync the "depot_tools" repository.
EOF
}
if [ $# -ne 0 ]; then
case $1 in
-h|--help)
usage
exit 0
;;
*)
echo "$0: ERROR: script takes no arguments: $*" >&2
exit 1
;;
esac
fi
# Export for other depot_tools scripts to re-use.
export DEPOT_TOOLS_DIR="${DEPOT_TOOLS_DIR:-$(dirname "${BASH_SOURCE[0]}")}"

Loading…
Cancel
Save