| #!/bin/bash | |
| # Copyright 2021 The Fuchsia Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| #### CATEGORY=Documentation | |
| #### PREBUILTS=${PREBUILT_BAZEL} ${PREBUILT_JQ} ${PREBUILT_LICENSE_CLASSIFIER} ${PREBUILT_PYTHON3} | |
| ### analyze the license state of a given package or directory | |
| ## USAGE: | |
| ## check-licenses | |
| ## ** Check //tools/check-licenses/README.md for more information | |
| _script_dir="${BASH_SOURCE[0]%/*}"; | |
| if [[ "${_script_dir}" == "${BASH_SOURCE[0]}" ]]; then _script_dir="."; fi | |
| readonly _script_dir | |
| source "${_script_dir}/../lib/vars.sh" || exit $? | |
| fx-config-read | |
| source "${_script_dir}/../lib/bazel_utils.sh" || exit $? | |
| export PREBUILT_3P_DIR HOST_PLATFORM | |
| fx-run-bazel false "$(fx-get-bazel)" run --config=host \ | |
| --run_env=FUCHSIA_DIR="${FUCHSIA_DIR}" \ | |
| --run_env=FUCHSIA_BUILD_DIR="${FUCHSIA_BUILD_DIR}" \ | |
| --run_env=BUILD_WORKING_DIRECTORY="${PWD}" \ | |
| '//tools/check-licenses' -- "$@" |