From 515b7aaf9ffee71473cd15d95a1511b72b59a6ff Mon Sep 17 00:00:00 2001 From: rwxrob Date: Sun, 6 Mar 2022 15:01:21 -0500 Subject: [PATCH] Add gocopyright --- scripts/gocopyright | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 scripts/gocopyright diff --git a/scripts/gocopyright b/scripts/gocopyright new file mode 100755 index 0000000..bd4c47d --- /dev/null +++ b/scripts/gocopyright @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +addcopyright() { + file=$(tempfile) + cat <(echo "// Copyright 2022 Robert S. Muhlestein +// SPDX-License-Identifier: Apache-2.0 + ") "$1" >> "$file" + mv "$file" "$1" +} + +for f in "$@"; do addcopyright "$f"; done