terraform/scripts/copyright.sh

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
612 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
# Copyright IBM Corp. 2014, 2026
# SPDX-License-Identifier: BUSL-1.1
# This script checks that all files have the appropriate copyright headers,
# according to their nearest .copywrite.hcl config file. The copyright tool
# does not natively support repos with multiple licenses, so we have to
# script this ourselves.
set -euo pipefail
# Find all directories containing a .copywrite.hcl config file
directories=$(find . -type f -name '.copywrite.hcl' -execdir pwd \;)
args=${1:-}
for dir in $directories; do
2025-02-12 08:27:24 -05:00
cd $dir && pwd && go tool github.com/hashicorp/copywrite headers $args
done