copywrite icon indicating copy to clipboard operation
copywrite copied to clipboard

Reflect nested config files when walking directories

Open radeksimko opened this issue 2 years ago • 0 comments

When a repository uses a mix of different licenses for different parts/directories (BUSL or MPL), then it is currently necessary to run copywrite in those nested directories in order for it to notice those nested directories.

For example, Terraform uses the following script to work around this limitation:

https://github.com/hashicorp/terraform/blob/2a5ff48e3d0342c1978adf97c63414fa06c8b9ed/scripts/copyright.sh#L12-L17

directories=$(find . -type f -name '.copywrite.hcl' -execdir pwd \;)

for dir in $directories; do
    cd $dir && go run github.com/hashicorp/copywrite headers
done

It would be great if this could be built into the tool, so we would not have to maintain this shell wrapper.

radeksimko avatar Feb 13 '24 12:02 radeksimko