From 85263aaae46f1ad6e7c555eec10f11b61e16222a Mon Sep 17 00:00:00 2001 From: Michael Valdron Date: Mon, 18 Sep 2023 00:35:56 -0400 Subject: [PATCH] addlicense script Signed-off-by: Michael Valdron --- add_licenses.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 add_licenses.sh diff --git a/add_licenses.sh b/add_licenses.sh new file mode 100755 index 000000000..2d1d460e7 --- /dev/null +++ b/add_licenses.sh @@ -0,0 +1,13 @@ +#!/bin/bash +# This script adds license headers that are missing from go files + + +if ! command -v addlicense 2> /dev/null +then + echo "error addlicense must be installed with this command: go install github.com/google/addlicense@latest" && exit 1 +else + echo 'addlicense -v -f license_header.txt **/*.go' + addlicense -v -f license_header.txt $(find . -not -path '*/\.*' -not -path '*/vendor/*' -name '*.go') +fi + +