| #!/usr/bin/env 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. |
| |
| set -o errexit |
| set -o pipefail |
| |
| # Run shac checks. This is only best-effort, so it's OK so skip if shac isn't |
| # available via the user's $PATH. |
| if command -v shac > /dev/null; then |
| shac_output_path=$(mktemp) |
| if ! shac check > "$shac_output_path"; then |
| # Only print shac's output in case of failure. |
| cat "$shac_output_path" |
| exit 1 |
| fi |
| fi |