diff --git a/Makefile b/Makefile index 1fd99aa..3813e5a 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,4 @@ +# Copyright 2024 Ian Lewis # Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -71,8 +72,8 @@ go-benchmark: ## Runs Go benchmarks. ## Tools ##################################################################### -.PHONY: autogen -autogen: ## Runs autogen on code files. +.PHONY: license-headers +license-headers: ## Update license headers. @set -euo pipefail; \ files=$$( \ git ls-files \ @@ -83,13 +84,19 @@ autogen: ## Runs autogen on code files. '*.yaml' '**/*.yaml' \ '*.yml' '**/*.yml' \ ); \ + name=$$(git config user.name); \ + if [ "$${name}" == "" ]; then \ + >&2 echo "git user.name is required."; \ + >&2 echo "Set it up using:"; \ + >&2 echo "git config user.name \"John Doe\""; \ + fi; \ for filename in $${files}; do \ if ! ( head "$${filename}" | grep -iL "Copyright" > /dev/null ); then \ - autogen -i --no-code --no-tlc -c "Google LLC" -l apache "$${filename}"; \ + autogen -i --no-code --no-tlc -c "$${name}" -l apache "$${filename}"; \ fi; \ done; \ if ! ( head Makefile | grep -iL "Copyright" > /dev/null ); then \ - autogen -i --no-code --no-tlc -c "Google LLC" -l apache Makefile; \ + autogen -i --no-code --no-tlc -c "$${name}" -l apache Makefile; \ fi; .PHONY: format