| #!/bin/bash | |
| # Copyright 2026 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 | |
| ### parse, format, and validate README.fuchsia files | |
| ## | |
| ## USAGE: | |
| ## fx readme_fuchsia <command> [args...] | |
| ## | |
| ## Commands: | |
| ## validate [--project-root <dir>] [--allow-missing-license] <path/to/README.fuchsia> | |
| ## format [--stdout] [path/to/README.fuchsia] | |
| ## get <field> [path/to/README.fuchsia] | |
| ## set <field> <value> [path/to/README.fuchsia] | |
| ## help | |
| ## | |
| ## ** Check //tools/readme_fuchsia/README.md for more information | |
| source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/../lib/vars.sh || exit $? | |
| fx-config-read | |
| BINARY="$(get_host_tools_dir)/readme_fuchsia" | |
| if [[ ! -x "${BINARY}" ]]; then | |
| fx-error "readme_fuchsia binary not found." | |
| echo "Please build it first by running:" | |
| echo " fx build --host //tools/readme_fuchsia:readme_fuchsia" | |
| exit 1 | |
| fi | |
| "${BINARY}" "$@" |